Beispiel #1
0
def init_logger():
    config = global_obj.get_obj("config")
    file = None
    if  "log" in config:
        file = config["log"]
    logger = CFileLog(file)
    global_obj.set_obj("logger", logger)
Beispiel #2
0
def init_mail():
    config = global_obj.get_obj("config")
    mail_data = config["mail"]
    obj = CMailBox(mail_data["user"], mail_data["password"], mail_data["host"])
    obj.SetSender(mail_data["user"])
    for name in mail_data["to"]:
        obj.SetReceive(name)
    global_obj.set_obj("mail", obj)
Beispiel #3
0
 def init_log_view(self):
     self.init_log_ui = CViewLog(self.centralwidget, self)
     global_obj.set_obj("ViewLog", self.init_log_ui)
Beispiel #4
0
def init_App():
    app = QtWidgets.QApplication(sys.argv)
    global_obj.set_obj("App", app)
    mainwindow = Oui_MainWindow()
    global_obj.set_obj("MainWindow", mainwindow)
    return app, mainwindow
Beispiel #5
0
def init_db():
    config = global_obj.get_obj("config")
    db_data = config["db"]
    obj = mongo_api.CMongodbManager(DB_NAME, db_data["addr"], db_data["port"],
                                    db_data["user"], db_data["password"])
    global_obj.set_obj("dbobj", obj)
Beispiel #6
0
def init_config(config_file=None):
    file = config_file if config_file else CONFIG_FILE
    data = config_api.load_config(file)
    global_obj.set_obj("config", data)