예제 #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 []
예제 #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 []
예제 #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 []
예제 #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)
예제 #5
0
파일: alarm.py 프로젝트: Petraea/jsonbot
 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)
예제 #6
0
파일: hubbub.py 프로젝트: melmothx/jsonbot
 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')
예제 #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)
예제 #8
0
파일: pdol.py 프로젝트: Lujeni/old-projects
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = {}
예제 #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 ""
예제 #10
0
 def __init__(self, keyname):
     Persist.__init__(
         self,
         getdatadir() + os.sep + 'keys' + os.sep + 'fish' + os.sep +
         stripname(keyname))
예제 #11
0
파일: pdod.py 프로젝트: melmothx/jsonbot
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data: self.data = LazyDict()
예제 #12
0
파일: pdod.py 프로젝트: melmothx/jsonbot
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data: self.data = LazyDict()
예제 #13
0
 def __init__(self, fname):
     Persist.__init__(self, fname)
     if not self.data: self.data = {}
예제 #14
0
파일: alarm.py 프로젝트: 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)
예제 #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)
예제 #16
0
파일: fish.py 프로젝트: Lujeni/old-projects
 def __init__(self, keyname):
   Persist.__init__(self, getdatadir() + os.sep + 'keys' + os.sep + 'fish' + os.sep + stripname(keyname))