def __init__(self, filename, host): PlugPersist.__init__(self, filename) if not self.data: self.data = LazyDict() if 'names' not in self.data: self.data['names'] = [] if 'urls' not in self.data: self.data['urls'] = {} if 'feeds' not in self.data: self.data['feeds'] = {} if 'host' not in self.data: self.data['host'] = host self.feeds = {}
def __init__(self, name): PlugPersist.__init__(self, name)
from tl.lib.commands import cmnds from tl.lib.callbacks import callbacks from tl.lib.examples import examples from tl.lib.persist import PlugPersist ## basic imports import time import os import logging ## defines changed = False idle = PlugPersist('idle.data') if not idle.data: idle.data = {} ## save on shutdown def ticksave(bot, event): global idle global changed if changed: idle.save() ; changed = False callbacks.add("TICK60", ticksave) ## callbacks def preidle(bot, event):
def __init__(self, filename): PlugPersist.__init__(self, filename) self.data.channels = self.data.channels or {} self.data.whitelist = self.data.whitelist or [] self.data.descriptions = self.data.descriptions or {}