示例#1
0
 def __init__(self):
     """constructor"""
     self.iniPath = common.get_config_path()
     self.ini = tempcreateini.TempCreateIni(self.iniPath)
     self.create_ui()
     self.set_default_value()
     Tkinter.mainloop()
示例#2
0
from celery.schedules import crontab

DEFAULTCONF = {
    'protocol': 'pyamqp',
    'host': 'localhost',
    'user': '******',
    'password': '',
    'vhost': '/',
    'flush_every': '100',
    'flush_interval': '10',
    'tz': 'US/Eastern',
}

config_object = configparser.SafeConfigParser()
config_object.optionxform = str
configfile = common.get_config_path(multiscanner.CONFIG, 'api')
config_object.read(configfile)

if not config_object.has_section('celery') or not os.path.isfile(configfile):
    # Write default config
    config_object.add_section('celery')
    for key in DEFAULTCONF:
        config_object.set('celery', key, str(DEFAULTCONF[key]))
    conffile = codecs.open(configfile, 'w', 'utf-8')
    config_object.write(conffile)
    conffile.close()
config = common.parse_config(config_object)
api_config = config.get('api')
worker_config = config.get('celery')
db_config = config.get('Database')
示例#3
0
文件: wxcreate.py 项目: weikent/tool
 def __init__(self):
     self.iniPath = common.get_config_path()
     self.ini = tempcreateini.TempCreateIni(self.iniPath)
     self.create_ui()
     self.set_default_value()