def __init__(self, *args, **kwargs): """ initialize the instance """ self.themelist = "" BasePlugin.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): """ init the class """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.cmds = {} self.nomultiplecmds = {} self.savehistfile = os.path.join(self.savedir, 'history.txt') self.cmdhistorydict = PersistentDict(self.savehistfile, 'c') if 'history' not in self.cmdhistorydict: self.cmdhistorydict['history'] = [] self.cmdhistory = self.cmdhistorydict['history'] self.api('api.add')('add', self.api_addcmd) self.api('api.add')('remove', self.api_removecmd) self.api('api.add')('change', self.api_changecmd) self.api('api.add')('default', self.api_setdefault) self.api('api.add')('removeplugin', self.api_removeplugin) self.api('api.add')('list', self.api_listcmds) self.api('api.add')('run', self.api_run) self.api('api.add')('cmdhelp', self.api_cmdhelp)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.password = '' self.api.get('api.add')('send', self.api_send)
def __init__(self, *args, **kwargs): """ Iniitialize the class self.gmcpcache - the cache of values for different GMCP modules self.modstates - the current counter for what modules have been enabled self.gmcpqueue - the queue of gmcp commands that the client sent before connected to the server self.gmcpmodqueue - the queue of gmcp modules that were enabled by the client before connected to the server """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.gmcpcache = {} self.modstates = {} self.gmcpqueue = [] self.gmcpmodqueue = [] self.reconnecting = False self.api.get('api.add')('sendpacket', self.api_sendpacket) self.api.get('api.add')('sendmodule', self.api_sendmodule) self.api.get('api.add')('togglemodule', self.api_togglemodule) self.api.get('api.add')('getv', self.api_getv)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.triggers = {} self.regexlookup = {} self.triggergroups = {} self.uniquelookup = {} self.regex = {} self.regex['color'] = "" self.regex['noncolor'] = "" self.api('api.add')('add', self.api_addtrigger) self.api('api.add')('remove', self.api_remove) self.api('api.add')('toggle', self.api_toggle) self.api('api.add')('gett', self.api_gett) self.api('api.add')('togglegroup', self.api_togglegroup) self.api('api.add')('toggleomit', self.api_toggleomit) self.api('api.add')('removeplugin', self.api_removeplugin) self.api('api.add')('update', self.api_update)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.savesubfile = os.path.join(self.savedir, 'subs.txt') self._substitutes = PersistentDict(self.savesubfile, 'c')
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.password = '' self.api('api.add')('send', self.api_send)
def __init__(self, *args, **kwargs): """ Iniitialize the class self.gmcpcache - the cache of values for different GMCP modules self.modstates - the current counter for what modules have been enabled self.gmcpqueue - the queue of gmcp commands that the client sent before connected to the server self.gmcpmodqueue - the queue of gmcp modules that were enabled by the client before connected to the server """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.gmcpcache = {} self.modstates = {} self.gmcpqueue = [] self.gmcpmodqueue = [] self.reconnecting = False self.api('api.add')('sendmud', self.api_sendmud) self.api('api.add')('sendmodule', self.api_sendmodule) self.api('api.add')('togglemodule', self.api_togglemodule) self.api('api.add')('getv', self.api_getv)
def __init__(self, *args, **kwargs): """ Iniitilaize the class """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False
def __init__(self, *args, **kwargs): """ init the class """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False #print('log api.api', self.api.api) #print('log basepath', self.api.BASEPATH) self.savedir = os.path.join(self.api.BASEPATH, 'data', 'plugins', self.sname) self.logdir = os.path.join(self.api.BASEPATH, 'data', 'logs') #print('logdir', self.logdir) try: os.makedirs(self.savedir) except OSError: pass self.dtypes = {} self.sendtoclient = PersistentDict( os.path.join(self.savedir, 'sendtoclient.txt'), 'c') self.sendtoconsole = PersistentDict( os.path.join(self.savedir, 'sendtoconsole.txt'), 'c') self.sendtofile = PersistentDict( os.path.join(self.savedir, 'sendtofile.txt'), 'c') self.currentlogs = {} self.colors = {} self.filenametemplate = '%a-%b-%d-%Y.log' #self.sendtofile['default'] = { #'logdir':os.path.join(self.logdir, 'default'), #'file':'%a-%b-%d-%Y.log', 'timestamp':True #} self.colors['error'] = '@x136' self.api('api.add')('msg', self.api_msg) self.api('api.add')('adddtype', self.api_adddtype) self.api('api.add')('console', self.api_toggletoconsole) self.api('api.add')('file', self.api_toggletofile) self.api('api.add')('client', self.api_toggletoclient) self.api('api.add')('writefile', self.api_writefile) # add some default datatypes self.api('log.adddtype')('default') self.api('log.adddtype')('frommud') self.api('log.adddtype')('startup') self.api('log.adddtype')('shutdown') self.api('log.adddtype')('error') # log some datatypes by default self.api('log.client')('error') self.api('log.console')('error') self.api('log.console')('default') self.api('log.console')('startup') self.api('log.console')('shutdown')
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) global markdown2 import markdown2
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.commandtraces = None self.changedmuddata = None
def __init__(self, tname, tsname, filename, directory, importloc): # pylint: disable=too-many-arguments """ Iniitilaize the class """ BasePlugin.__init__(self, tname, tsname, filename, directory, importloc) self.canreload = False
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.aliasfile = os.path.join(self.savedir, 'aliases.txt') self._aliases = PersistentDict(self.aliasfile, 'c') self.sessionhits = {}
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.api('dependency.add')('ssc') self.apikey = None self.api('api.add')('note', self.api_note) self.api('api.add')('link', self.api_link)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.api.get('dependency.add')('ssc') self.apikey = None self.api('api.add')('note', self.api_note) self.api('api.add')('link', self.api_link)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.errors = [] self.api('api.add')('add', self.api_adderror) self.api('api.add')('gete', self.api_geterrors) self.api('api.add')('clear', self.api_clearerrors)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.api('api.add')('iscolor', self.api_iscolor) self.api('api.add')('convertcolors', self.api_convertcolors) self.api('api.add')('convertansi', self.api_convertansi) self.api('api.add')('ansicode', self.api_ansicode) self.api('api.add')('stripansi', self.api_stripansi) self.api('api.add')('stripcolor', self.api_stripcolor) self.api('api.add')('lengthdiff', self.api_getlengthdiff) self.api('api.add')('colortohtml', self.api_colorcodestohtml)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.variablefile = os.path.join(self.savedir, 'variables.txt') self._variables = PersistentDict(self.variablefile, 'c') self.api.get('api.add')('getv', self.api_getv) self.api.get('api.add')('setv', self.api_setv) self.api.get('api.add')('replace', self.api_replace)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.variablefile = os.path.join(self.savedir, 'variables.txt') self._variables = PersistentDict(self.variablefile, 'c') self.api('api.add')('getv', self.api_getv) self.api('api.add')('setv', self.api_setv) self.api('api.add')('replace', self.api_replace)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.firstactive = False self.connected = False self.sentchar = False self.sentquest = False self.sentroom = False # the firstactive flag self.api('api.add')('firstactive', self.api_firstactive)
def __init__(self): """ initialize the instance """ # Examples: # name : 'Actions' - from plugin file variable NAME (long name) # sname : 'actions' - from plugin file variable SNAME (short name) # modpath : '/client/actions.py' - path relative to the plugins directory # basepath : '/home/src/games/bastproxy/bp/plugins' - the full path to the # plugins directory # fullimploc : 'plugins.client.actions' - import location #name, sname, modpath, basepath, fullimploc BasePlugin.__init__( self, 'Plugin Manager', #name, 'plugins', #sname, "/__init__.py", #modpath "$basepath$", # basepath "plugins.__init__", # fullimploc ) self.canreload = False #key: modpath #value: {'plugin', 'module'} self.loadedpluginsd = {} self.pluginlookupbysname = {} self.pluginlookupbyname = {} self.pluginlookupbyfullimploc = {} # key: modpath # value: {'sname', 'name', 'purpose', 'author', # 'version', 'modpath', 'fullimploc' self.allplugininfo = {} index = __file__.rfind(os.sep) if index == -1: self.basepath = "." + os.sep else: self.basepath = __file__[:index] self.savefile = os.path.join(self.api.BASEPATH, 'data', 'plugins', 'loadedplugins.txt') self.loadedplugins = PersistentDict(self.savefile, 'c') self.api('api.add')('isloaded', self._api_isloaded) self.api('api.add')('getp', self._api_getp) self.api('api.add')('module', self._api_getmodule) self.api('api.add')('allplugininfo', self._api_allplugininfo) self.api('api.add')('savestate', self.savestate)
def __init__(self): """ initialize the instance """ # Examples: # name : 'Actions' - from plugin file variable NAME (long name) # sname : 'actions' - from plugin file variable SNAME (short name) # modpath : '/client/actions.py' - path relative to the plugins directory # basepath : '/home/src/games/bastproxy/bp/plugins' - the full path to the # plugins directory # fullimploc : 'plugins.client.actions' - import location #name, sname, modpath, basepath, fullimploc BasePlugin.__init__(self, 'Plugin Manager', #name, 'plugins', #sname, "/__init__.py", #modpath "$basepath$", # basepath "plugins.__init__", # fullimploc ) self.canreload = False #key: modpath #value: {'plugin', 'module'} self.loadedpluginsd = {} self.pluginlookupbysname = {} self.pluginlookupbyname = {} self.pluginlookupbyfullimploc = {} # key: modpath # value: {'sname', 'name', 'purpose', 'author', # 'version', 'modpath', 'fullimploc' self.allplugininfo = {} index = __file__.rfind(os.sep) if index == -1: self.basepath = "." + os.sep else: self.basepath = __file__[:index] self.savefile = os.path.join(self.api.BASEPATH, 'data', 'plugins', 'loadedplugins.txt') self.loadedplugins = PersistentDict(self.savefile, 'c') self.api('api.add')('isloaded', self._api_isloaded) self.api('api.add')('getp', self._api_getp) self.api('api.add')('module', self._api_getmodule) self.api('api.add')('allplugininfo', self._api_allplugininfo) self.api('api.add')('savestate', self.savestate)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.api.get('dependency.add')('ssc') self.proxypw = None self.proxyvpw = None self.mudpw = None self.api.get('api.add')('restart', self.api_restart)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.firstactive = False self.connected = False self.gotchar = False self.gotroom = False self.sentchar = False self.sentquest = False # the firstactive flag self.api.get("api.add")("firstactive", self.api_firstactive)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.regexlookup = {} self.watchcmds = {} self.api('api.add')('add', self.api_addwatch) self.api('api.add')('remove', self.api_removewatch) self.api('api.add')('removeplugin', self.api_removeplugin)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.api('dependency.add')('ssc') self.proxypw = None self.proxyvpw = None self.mudpw = None self.api('api.add')('restart', self.api_restart) self.api('api.add')('shutdown', self.api_shutdown)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.regexlookup = {} self.watchcmds = {} self.api.get('api.add')('add', self.api_addwatch) self.api.get('api.add')('remove', self.api_removewatch) self.api.get('api.add')('removeplugin', self.api_removeplugin)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.events = {} self.pluginlookup = {} self.api.get('api.add')('register', self.api_register) self.api.get('api.add')('unregister', self.api_unregister) self.api.get('api.add')('eraise', self.api_eraise) self.api.get('api.add')('removeplugin', self.api_removeplugin) self.api.get('api.add')('gete', self.api_getevent) self.api.get('api.add')('detail', self.api_detail)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = True self.regexlookup = {} self.actiongroups = {} self.compiledregex = {} self.sessionhits = {} self.saveactionsfile = os.path.join(self.savedir, 'actions.txt') self.actions = PersistentDict(self.saveactionsfile, 'c')
def __init__(self, *args, **kwargs): """ initialize the plugin """ BasePlugin.__init__(self, *args, **kwargs) self.api('api.add')('timedeltatostring', self.api_timedeltatostring) self.api('api.add')('readablenumber', self.api_readablenumber) self.api('api.add')('secondstodhms', self.api_secondstodhms) self.api('api.add')('formattime', self.api_formattime) self.api('api.add')('center', self.api_center) self.api('api.add')('checklistformatch', self.api_checklistformatch) self.api('api.add')('timelengthtosecs', self.api_timelengthtosecs) self.api('api.add')('verify', self.api_verify) self.api('api.add')('listtocolumns', self.listtocolumns)
def __init__(self, *args, **kwargs): """ initialize the plugin """ BasePlugin.__init__(self, *args, **kwargs) self.api.get('api.add')('timedeltatostring', self.api_timedeltatostring) self.api.get('api.add')('readablenumber', self.api_readablenumber) self.api.get('api.add')('secondstodhms', self.api_secondstodhms) self.api.get('api.add')('formattime', self.api_formattime) self.api.get('api.add')('center', self.api_center) self.api.get('api.add')('checklistformatch', self.api_checklistformatch) self.api.get('api.add')('timelengthtosecs', self.api_timelengthtosecs) self.api.get('api.add')('verify', self.api_verify) self.api.get('api.add')('funccallerplugin', self.api_callerplugin)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.queue = [] self.cmds = {} self.currentcmd = {} self.reloaddependents = True # self.api('api.add')('baseclass', self.api_baseclass) self.api('api.add')('addtoqueue', self._api_addtoqueue) self.api('api.add')('cmdstart', self._api_commandstart) self.api('api.add')('cmdfinish', self._api_commandfinish) self.api('api.add')('addcmdtype', self._api_addcmdtype) self.api('api.add')('rmvcmdtype', self._api_rmvcmdtype) self.api('api.add')('removeplugin', self.api_removeplugin)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.clients = [] self.vclients = [] self.banned = {} self.api('api.add')('getall', self.api_getall) self.api('api.add')('addbanned', self.api_addbanned) self.api('api.add')('checkbanned', self.api_checkbanned) self.api('api.add')('numconnected', self.api_numconnected)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.timerevents = {} self.timerlookup = {} self.overallfire = 0 self.lasttime = int(time.time()) self.api.get('api.add')('add', self.api_addtimer) self.api.get('api.add')('remove', self.api_remove) self.api.get('api.add')('toggle', self.api_toggle) self.api.get('api.add')('removeplugin', self.api_removeplugin)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.timerevents = {} self.timerlookup = {} self.overallfire = 0 self.lasttime = int(time.time()) self.api('api.add')('add', self.api_addtimer) self.api('api.add')('remove', self.api_remove) self.api('api.add')('toggle', self.api_toggle) self.api('api.add')('removeplugin', self.api_removeplugin)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.options = {} self.optionsmod = {} self.clientoptions = {} self.serveroptions = {} self.api.get('api.add')('addserveroption', self.api_addserveroption) self.api.get('api.add')('addclientoption', self.api_addclientoption) self.api.get('api.add')('prepareclient', self.api_prepareclient) self.api.get('api.add')('prepareserver', self.api_prepareserver) self.api.get('api.add')('resetoptions', self.api_resetoptions)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.options = {} self.optionsmod = {} self.clientoptions = {} self.serveroptions = {} self.api('api.add')('addserveroption', self.api_addserveroption) self.api('api.add')('addclientoption', self.api_addclientoption) self.api('api.add')('prepareclient', self.api_prepareclient) self.api('api.add')('prepareserver', self.api_prepareserver) self.api('api.add')('resetoptions', self.api_resetoptions)
def __init__(self, *args, **kwargs): """ initialize the instance """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.triggers = {} self.regexlookup = {} self.triggergroups = {} self.api.get("api.add")("add", self.api_addtrigger) self.api.get("api.add")("remove", self.api_remove) self.api.get("api.add")("toggle", self.api_toggle) self.api.get("api.add")("gett", self.api_gett) self.api.get("api.add")("togglegroup", self.api_togglegroup) self.api.get("api.add")("toggleomit", self.api_toggleomit) self.api.get("api.add")("removeplugin", self.api_removeplugin)
def __init__(self, *args, **kwargs): """ Initialize the class self.optionstates - the current counter for what options have been enabled self.a102optionqueue - the queue of a102 options that were enabled by the client before connected to the server """ BasePlugin.__init__(self, *args, **kwargs) self.canreload = False self.optionstates = {} self.a102optionqueue = [] self.reconnecting = False self.api('api.add')('sendmud', self.api_sendmud) self.api('api.add')('toggle', self.api_toggle)
def __init__(self, tname, tsname, filename, directory, importloc): """ Iniitilaize the class self.optionsstates - the current counter for what options have been enabled self.a102optionqueue - the queue of a102 options that were enabled by the client before connected to the server """ BasePlugin.__init__(self, tname, tsname, filename, directory, importloc) self.canreload = False self.optionstates = {} self.a102optionqueue = [] self.reconnecting = False self.api.get('api.add')('sendpacket', self.api_sendpacket) self.api.get('api.add')('toggle', self.api_toggle)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.reloaddependents = True self.api('api.add')('baseclass', self.api_baseclass)
def __init__(self, *args, **kwargs): BasePlugin.__init__(self, *args, **kwargs) self.api('dependency.add')('aardwolf.connect') self.api('dependency.add')('aardwolf.aardu') self.api('dependency.add')('aardwolf.agmcp')