Exemplo n.º 1
0
Arquivo: users.py Projeto: code2u/jsb
 def __init__(self, filename):
     self.userhosts = {}
     self.masks = {}
     self.compiled = {}
     Persist.__init__(self, filename)
     if not self.data:
         self.data = []
     for i in self.data:
         for j in i.userhosts:
             self.adduserhost(j, i)
Exemplo n.º 2
0
Arquivo: todo.py Projeto: code2u/jsb
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data:
         return
     for key in self.data.keys():
         todoos = self.data[key]
         for (k, v) in todoos.data.items():
             v.num = k
         newd = Todolist()
         for i in todoos:
             newd.append(i)
         self.data[key] = newd
Exemplo n.º 3
0
 def __init__(self):
     self.__basename__ = self.__class__.__name__
     self.plugname = calledfrom(sys._getframe())
     Persist.__init__(self, os.path.join(datadir, "%s-config" % self.plugname), {})
     self.__callbacks = {}
     cmndname = "%s-cfg" % self.plugname
     logging.info("added command %s (%s)" % (cmndname, self.plugname))
     cmnds[cmndname] = Command(self.cmnd_cfg, "OPER", self.plugname, threaded=True)
     examples.add(cmndname, "plugin configuration", cmndname)
     cmndnamesave = cmndname + "save"
     cmnds[cmndnamesave] = Command(self.cmnd_cfgsave, "OPER", self.plugname, threaded=True)
     examples.add(cmndnamesave, "save plugin configuration", cmndnamesave)
Exemplo n.º 4
0
Arquivo: pdod.py Projeto: code2u/jsb
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data:
         self.data = {}