def __init__(self, config): # Call parent class's __init__ method asynchat.async_chat.__init__(self) # Define some private instance variables self._buffer = [] # Are we logged in? self._loggedin = False # Set our terminator to \n self.set_terminator("\r\n") # Set config self._config = config # find plugins and load/config them self.plugins = [] pluginClasses = BasePlugin.find_subclasses("./plugins/") for plugin in pluginClasses: plugincfg = "./plugins/" + plugin.__name__ + ".cfg" self.plugins.append(plugin(plugincfg)) # Reconnect delay self._retrydelay = 10 self.do_connect()
def __init__(self, config): # Are we logged in? self._loggedin = False self._has_partition_state_changed = False # Set config self._config = config self._shuttingdown = False self._triggerid = reactor.addSystemEventTrigger('before', 'shutdown', self.shutdownEvent) # find plugins and load/config them self.plugins = [] pluginClasses = BasePlugin.find_subclasses("./plugins/") for plugin in pluginClasses: plugincfg = "./plugins/" + plugin.__name__ + ".cfg" self.plugins.append(plugin(plugincfg)) self._commandinprogress = False now = datetime.now() self._lastkeypadupdate = now self._lastpoll = now self._lastzonedump = now self._lastcommand = now self._lastcommandresponse = now
def __init__(self, config): # Are we logged in? self._loggedin = False self._has_partition_state_changed = False # Set config self._config = config # find plugins and load/config them self.plugins = [] pluginClasses = BasePlugin.find_subclasses("./plugins/") for plugin in pluginClasses: plugincfg = "./plugins/" + plugin.__name__ + ".cfg" self.plugins.append(plugin(plugincfg)) self._commandinprogress = False now = datetime.now() self._lastkeypadupdate = now self._lastpoll = now self._lastzonedump = now self._lastpartitionupdate = now self._lastcommand = now self._lastcommandresponse = now