Ejemplo n.º 1
0
 def __init__(self, name):
     self.name = name
     try: import waveapi
     except:
         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 []
Ejemplo n.º 2
0
 def __init__(self, id, botname=None, type="notset", needexist=False):
     if not id: raise NoChannelSet()
     if not botname: Persist.__init__(self, getdatadir() + os.sep + 'channels' + os.sep + stripname(id), needexist=needexist)
     else: Persist.__init__(self, getdatadir() + os.sep + 'fleet' + os.sep + stripname(botname) + os.sep + 'channels' + os.sep + stripname(id), needexist=needexist)
     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.taglist = self.data.taglist 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 "jsb"
     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.º 3
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 []
Ejemplo n.º 4
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if type(self.data) == types.ListType:
         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.º 5
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if type(self.data) == types.ListType:
         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.º 6
0
 def __init__(self, name, url="", owner="", itemslist=['title', 'link'], watchchannels=[], running=1):
     filebase = getdatadir() + os.sep + 'plugs' + os.sep + 'jsb.plugs.wave.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.º 7
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 + botname + os.sep + 'channels' + os.sep + stripname(id))
     self.id = id
     self.type = type
     self.lastmodified = time.time()
     self.data.id = id
     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 "jsb"
     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 []
     logging.debug("channelbase - created channel %s" % id)
Ejemplo n.º 8
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = {}
Ejemplo n.º 9
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.º 10
0
 def __init__(self, keyname):
     Persist.__init__(
         self,
         getdatadir() + os.sep + 'keys' + os.sep + 'fish' + os.sep +
         stripname(keyname))
Ejemplo n.º 11
0
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data: self.data = LazyDict()
Ejemplo n.º 12
0
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data: self.data = LazyDict()
Ejemplo n.º 13
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = {}
Ejemplo n.º 14
0
Archivo: alarm.py Proyecto: code2u/jsb
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = []
     for i in self.data:
         z = Alarmitem(d=i)
         periodical.addjob(z.time - time.time(), 1, self.alarmsay, z.nick, z)
Ejemplo n.º 15
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.º 16
0
 def __init__(self, keyname):
   Persist.__init__(self, getdatadir() + os.sep + 'keys' + os.sep + 'fish' + os.sep + stripname(keyname))