This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SASL extends ListenerAdapter { | |
String user = "user"; // Change accordingly! | |
String password = "password"; // Change accordingly! | |
boolean connected = false; | |
@Override | |
public void onMotd(MotdEvent event) throws Exception { | |
connected = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.gmail.entityreborn.launchii.config; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2, os, urlparse, re | |
from BeautifulSoup import BeautifulSoup | |
# User variables | |
DESTFOLDER = "STAD" | |
OVERWRITEHTML = True | |
OVERWRITEPICS = False | |
LASTCHAPTER = 81 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event(object): | |
def __init__(self): | |
self._subscribers = [] | |
def attach(self, func): | |
self._subscribers.append(func) | |
def detach(self, func): | |
self._subscribers.remove(func) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, Integer, String, Table | |
from sqlalchemy import ForeignKey, DateTime, create_engine | |
from sqlalchemy.orm import sessionmaker, relationship, backref | |
from datetime import datetime | |
Base = declarative_base() | |
class Ingredient(Base): | |
__tablename__ = 'ingredients' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy import ForeignKey, DateTime, create_engine | |
from sqlalchemy.orm import sessionmaker, relationship, backref | |
from datetime import datetime | |
Base = declarative_base() | |
class Ingredient(Base): | |
__tablename__ = 'ingredients' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import RLock | |
import traceback, inspect | |
class BadArgLength(AttributeError): pass | |
class Subscriber(object): | |
def __init__(self, func, subscriberargs): | |
self.func = func | |
self.args = subscriberargs | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import RLock | |
import traceback | |
class Hook(object): | |
NONEVALUE = object() | |
def __init__(self, doc=None): | |
if doc: | |
self.__doc__ = doc | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
import traceback | |
import mechanize | |
KILOBYTE = 1024 | |
MEGABYTE = KILOBYTE * KILOBYTE | |
BUFFER = MEGABYTE / 2 | |
class Downloader(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import RLock | |
from collections import defaultdict | |
import traceback | |
class Hookable(object): | |
NONEVALUE = object() | |
def __init__(self): | |
self.hooks = defaultdict(list) | |
self.hooklock = RLock() |