Пример #1
0
 def syncold(self, filename, remove=False):
     """ sync with old config data """
     if os.path.isfile(filename):
         synckey = "persistconfig-syncold"
         oldconfig = Persist(filename)
         if not oldconfig.data.has_key(synckey):
             logging.warn("syncing old config %s with persistconfig" % filename)
             for i, j in oldconfig.data.iteritems():
                 if i == synckey:
                     continue
                 if j and not self.get(i):
                     self.set(i, oldconfig.data[i])
             oldconfig.data[synckey] = time.localtime()
             oldconfig.save()
         del oldconfig
         if remove:
             os.unlink(filename)
Пример #2
0
Файл: pdod.py Проект: code2u/jsb
 def save(self):
     Persist.save(self)