代码拉取完成,页面将自动刷新
#./main.py -- Main File starts from here.
#coding:utf-8
# Import Needs
from utils import log
import os, sys
import inspect
from constants import *
# Init Logging
debuger = log.Logger(os.path.join(LOG_FILE_PATH, "debug/"), level=DEBUG)
infoer = log.Logger(os.path.join(LOG_FILE_PATH, "debug/"))
errorer = log.Logger("&print", level=ERROR)
fataler = log.Logger("&win", level=FATAL)
loggerset = log.LoggerSet(debuger, infoer, errorer, fataler)
# System Info
loggerset.log("Main program started.", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("Running Path: "+os.getcwd(), ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("Python Interpretor Version: 3.8 (64-bit)", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("Python Path: "+str(sys.path), ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
# Security Check
loggerset.log("Starting Self Security Check...", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
try: # Import Security Check
loggerset.log("Try to import Self Security Check...", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
import selfcheck
except Exception as e: # Import Security Check Failed!
loggerset.log(e,level=ERROR, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("Security Check module not found!", level=ERROR, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("No Security Check has been done... It may be harmful!", level=WARNING, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
else:
try: # Start Self Check
loggerset.log("Starting Self Check...", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
start = selfcheck.selfcheck(loggerset)
except Exception as e: # Self Check Failed!
loggerset.log(e, level=ERROR, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
loggerset.log("Self Security Check failed!", level=FATAL, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
raise
else:
loggerset.log("Self Service Check success!", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
# Start point
loggerset.log("Try to start mainfile startpoint...", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
try:
start(loggerset) # Try to start.
except ModuleNotFoundError:
loggerset.log("No startpoints found!", level=FATAL, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
raise
except Exception as e:
loggerset.log(e, level=FATAL, ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
print("A fatal error happened...")
print("Please check your ")
raise
# End point
loggerset.log("Main program stopped.", ln=inspect.getframeinfo(inspect.currentframe()).lineno, filename=__file__)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。