Ejemplo n.º 1
0
 def __init__(self, id, botname=None, type="notset"):
     if not id: raise NoChannelSet()
     if not botname: Persist.__init__(self, getdatadir() + os.sep + 'channels' + os.sep + stripname(id))
     else: Persist.__init__(self, getdatadir() + os.sep + 'fleet' + os.sep + stripname(botname) + os.sep + 'channels' + os.sep + stripname(id))
     self.id = id
     self.type = type
     self.lastmodified = time.time()
     self.data.id = id
     self.data.enable = self.data.enable or False
     self.data.ops = self.data.ops or []
     self.data.silentcommands = self.data.silentcommands or []
     self.data.allowcommands = self.data.allowcommands or []
     self.data.feeds = self.data.feeds or []
     self.data.forwards = self.data.forwards or []
     self.data.allowwatch = self.data.allowwatch or []
     self.data.watched = self.data.watched or []
     self.data.passwords = self.data.passwords or {}
     self.data.cc = self.data.cc or "!"
     self.data.nick = self.data.nick or "tl"
     self.data.key = self.data.key or ""
     self.data.denyplug = self.data.denyplug or []
     self.data.createdfrom = whichmodule()
     self.data.cacheindex = 0
     self.data.tokens = self.data.tokens or []
     self.data.webchannels = self.data.webchannels or []
Ejemplo n.º 2
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if type(self.data) == list:
         tmp = {}
         for i in range(self.data):
             tmp[i] = self.data[i]
         self.data = tmp                
     for i in self.data:
         z = Alarmitem(d=self.data[i])
         periodical.addjob(z.time - time.time(), 1, self.alarmsay, z.nick, z)
Ejemplo n.º 3
0
 def __init__(self, name, url="", owner="", itemslist=['title', 'link'], watchchannels=[], running=1):
     filebase = getdatadir() + os.sep + 'plugs' + os.sep + 'tl.plugs.extra.hubbub' + os.sep + name
     Persist.__init__(self, filebase + os.sep + name + '.core')
     if not self.data: self.data = {}
     self.data = LazyDict(self.data)
     self.data['name'] = self.data.name or str(name)
     self.data['url'] = self.data.url or str(url)
     self.data['owner'] = self.data.owner or str(owner)
     self.data['watchchannels'] = self.data.watchchannels or list(watchchannels)
     self.data['running'] = self.data.running or running
     self.itemslists = Pdol(filebase + os.sep + name + '.itemslists')
     self.markup = Pdod(filebase + os.sep + name + '.markup')
Ejemplo n.º 4
0
 def __init__(self, keyname):
   Persist.__init__(self, getdatadir() + os.sep + 'keys' + os.sep + 'fish' + os.sep + stripname(keyname))
Ejemplo n.º 5
0
 def __init__(self, url, txt=None, *args, **kwargs):
     Persist.__init__(self, getdatadir() + os.sep + "spider" + os.sep + "data" + os.sep + stripname(url), *args, **kwargs)
     self.data.url = url
     self.data.txt = txt or self.data.txt or ""
Ejemplo n.º 6
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = {}
Ejemplo n.º 7
0
 def __init__(self, url):
     self.scantime = 0
     self.url = Url(url)
     self.fname = getdatadir() + os.sep + 'spider' + os.sep + 'stats' + os.sep + stripname(url)
     Persist.__init__(self, self.fname)
Ejemplo n.º 8
0
 def __init__(self, name):
     self.name = name
     if not os.path.exists(getdatadir() + os.sep +'gatekeeper'): os.mkdir(getdatadir() + os.sep + 'gatekeeper')
     Persist.__init__(self, getdatadir() + os.sep + 'gatekeeper' + os.sep + name)
     self.data.whitelist = self.data.whitelist or []