def __init__(self, confPath=None): """__init__ """ if not confPath: confPath = os.path.join(FILE_PATH, "conf", "db.conf") self.data = get_configs(confPath)
def __init__(self, confPath=None): """__init__ """ if not confPath: confPath = os.path.join(FILE_PATH, "conf", "db.conf") data = get_configs(confPath) self.db_handle = MySQL(data['appbuilder'])
"""whitehand """ import os from lib.configure import get_configs import threading import time import datetime import sys import logging from apscheduler.schedulers.blocking import BlockingScheduler FILE_PATH = (os.path.dirname(os.path.realpath(__file__))) confPath = os.path.join(FILE_PATH, "conf", "whitehand.conf") arrScripts = get_configs(confPath) #{'script_threads': {'period': '10', 'filename': 'b.py'}} def getObj(_cls_name): """ python反射 """ _packet_name = 'scriptthreads.' + _cls_name _module_home = __import__(_packet_name, globals(), locals(), [_cls_name]) obj = getattr(_module_home, _cls_name) return obj def main():
import os from lib.configure import get_configs import threading import time import datetime import sys import logging from apscheduler.schedulers.blocking import BlockingScheduler FILE_PATH = (os.path.dirname(os.path.realpath(__file__))) confPath = os.path.join(FILE_PATH, "conf", "whitehand.conf") arrScripts= get_configs(confPath) #{'script_threads': {'period': '10', 'filename': 'b.py'}} def getObj(_cls_name): """ python反射 """ _packet_name = 'scriptthreads.' + _cls_name _module_home = __import__(_packet_name, globals(), locals(), [_cls_name]) obj = getattr(_module_home, _cls_name) return obj