2021-06-12 07:09:26 +00:00
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
from os import system, name
|
|
|
|
import platform
|
|
|
|
|
|
|
|
empty_delim = " "
|
|
|
|
hard_divided_delim = "|"
|
2021-06-12 23:57:16 +00:00
|
|
|
soft_divided_delim = "|"
|
2021-06-12 07:09:26 +00:00
|
|
|
l_brack = "["
|
|
|
|
r_brack = "]"
|
|
|
|
|
|
|
|
ERR = "[ERR]"
|
|
|
|
INF = "[INF]"
|
|
|
|
|
|
|
|
stdout = sys.stdout
|
|
|
|
stderr = sys.stderr
|
|
|
|
|
|
|
|
def log(target, level, message, code = 0):
|
|
|
|
|
2021-08-13 21:57:03 +00:00
|
|
|
message = time.ctime() + empty_delim + str(level) + l_brack + f"{code:+05}" + r_brack + empty_delim + soft_divided_delim + empty_delim + message
|
2021-06-12 07:09:26 +00:00
|
|
|
print(message, file = target)
|
|
|
|
|
|
|
|
def clear():
|
|
|
|
if name == "nt":
|
|
|
|
system("cls")
|
|
|
|
else:
|
|
|
|
system("clear")
|
|
|
|
|
|
|
|
def splash(version):
|
|
|
|
|
|
|
|
def hrule():
|
|
|
|
print("#"+38*"-"+"#")
|
|
|
|
def box(s):
|
|
|
|
temp = "|"
|
|
|
|
temp += s
|
|
|
|
temp += (40-len(s)-2)*" "
|
|
|
|
temp += "|"
|
|
|
|
print(temp)
|
|
|
|
|
|
|
|
hrule()
|
|
|
|
box(" superscript version: " + version)
|
|
|
|
box(" os: " + platform.system())
|
|
|
|
box(" python: " + platform.python_version())
|
|
|
|
hrule()
|