Пример #1
0
 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)
Пример #2
0
Файл: todo.py Проект: 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
Пример #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)
Пример #4
0
Файл: pdod.py Проект: code2u/jsb
 def __init__(self, filename):
     Persist.__init__(self, filename)
     if not self.data:
         self.data = {}