예제 #1
0
파일: tkcreate.py 프로젝트: meteor1113/tool
 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()