co6co 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- co6co-0.0.1/PKG-INFO +12 -0
- co6co-0.0.1/co6co.egg-info/PKG-INFO +12 -0
- co6co-0.0.1/co6co.egg-info/SOURCES.txt +10 -0
- co6co-0.0.1/co6co.egg-info/dependency_links.txt +1 -0
- co6co-0.0.1/co6co.egg-info/requires.txt +6 -0
- co6co-0.0.1/co6co.egg-info/top_level.txt +1 -0
- co6co-0.0.1/co6co.egg-info/zip-safe +1 -0
- co6co-0.0.1/setup.cfg +4 -0
- co6co-0.0.1/setup.py +25 -0
- co6co-0.0.1/src/__init__.py +1 -0
- co6co-0.0.1/src/log/__init__.py +1 -0
- co6co-0.0.1/src/log/log.py +77 -0
co6co-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: co6co
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: 基础模块
|
|
5
|
+
Home-page: http://git.hub.com/co6co
|
|
6
|
+
Author: co6co
|
|
7
|
+
Author-email: co6co@qq.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# 基础组件
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: co6co
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: 基础模块
|
|
5
|
+
Home-page: http://git.hub.com/co6co
|
|
6
|
+
Author: co6co
|
|
7
|
+
Author-email: co6co@qq.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# 基础组件
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
co6co-0.0.1/setup.cfg
ADDED
co6co-0.0.1/setup.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
# read readmeFile contents
|
|
4
|
+
from os import path
|
|
5
|
+
currentDir = path.abspath(path.dirname(__file__))
|
|
6
|
+
with open(path.join(currentDir, 'README.md'), encoding='utf-8') as f: long_description = f.read()
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
VERSION = '0.0.1'
|
|
10
|
+
setup(
|
|
11
|
+
name="co6co",
|
|
12
|
+
version=VERSION,
|
|
13
|
+
description="基础模块",
|
|
14
|
+
packages=find_packages(),
|
|
15
|
+
long_description=long_description,
|
|
16
|
+
long_description_content_type='text/markdown',
|
|
17
|
+
classifiers=[ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ],
|
|
18
|
+
include_package_data=True, zip_safe=True,
|
|
19
|
+
#依赖哪些模块
|
|
20
|
+
install_requires=['loguru', "requests>=2.22.0", "Flask>=1.0.3", "APScheduler>=3.6.0", "tinydb>=3.13.0", "Flask-BasicAuth>=0.2.0" ],
|
|
21
|
+
#package_dir= {'':'src'},#告诉Distutils哪些目录下的文件被映射到哪个源码
|
|
22
|
+
author='co6co',
|
|
23
|
+
author_email ='co6co@qq.com',
|
|
24
|
+
url="http://git.hub.com/co6co"
|
|
25
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#-*- coding:utf-8 -*-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#-*- coding:utf-8 -*-
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
import datetime,sys,threading,os
|
|
3
|
+
from loguru import logger
|
|
4
|
+
|
|
5
|
+
logger.remove()
|
|
6
|
+
logger.add(sys.stdout,level="INFO",format="{file}\t{line}\t{message}")
|
|
7
|
+
'''
|
|
8
|
+
#https://blog.csdn.net/Kangyucheng/article/details/112794185
|
|
9
|
+
TRACE 5 trace()
|
|
10
|
+
DEBUG 10 debug()
|
|
11
|
+
INFO 20 info()
|
|
12
|
+
SUCCESS 25 success()
|
|
13
|
+
WARNING 30 warning()
|
|
14
|
+
ERROR 40 error()
|
|
15
|
+
CRITICAL 50 critical()
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
LEVEL_LIST=["TRACE","DEBUG","INFO","SUCCESS","WARNING","ERROR","CRITICAL"]
|
|
20
|
+
folder="."
|
|
21
|
+
if os.name =="nt":folder="c:\log\python"
|
|
22
|
+
elif os.name =="posix":folder="./log"
|
|
23
|
+
|
|
24
|
+
for level in LEVEL_LIST:
|
|
25
|
+
fileNamePart=f"{level}.log"
|
|
26
|
+
p=os.path.join(folder,"loguru_{time:YY-MM}_"+fileNamePart)
|
|
27
|
+
logger.add(p ,rotation="5 MB",level=level, encoding="utf-8" ,retention='7 days' ,format="{time:YY-MM-DD HH:mm:ss}\t{level}\t{file}\t{line}\t{message}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
'''
|
|
31
|
+
\033[显示方式;前景色;背景色m*******\033[0m
|
|
32
|
+
\033[显示方式;前景色;背景色m*******\033[0m
|
|
33
|
+
显示方式: 0:默认值
|
|
34
|
+
1:高亮
|
|
35
|
+
4:下划线
|
|
36
|
+
5:闪烁
|
|
37
|
+
7:反显
|
|
38
|
+
8:不可见
|
|
39
|
+
控制台颜色值:
|
|
40
|
+
前景色 背景色 颜色说明
|
|
41
|
+
30 40 黑色
|
|
42
|
+
31 41 红色
|
|
43
|
+
32 42 绿色
|
|
44
|
+
33 43 黄色
|
|
45
|
+
34 44 蓝色
|
|
46
|
+
35 45 紫红色
|
|
47
|
+
36 46 青蓝色
|
|
48
|
+
37 47 白色
|
|
49
|
+
'''
|
|
50
|
+
def __log(msg,type:int=0,foregroundColor:int=37,bg=40,e=None,hasPrefix:bool=True):
|
|
51
|
+
t=threading.currentThread()
|
|
52
|
+
time = datetime.datetime.now()
|
|
53
|
+
err=e.__traceback__.tb_lineno if e !=None else ""
|
|
54
|
+
prefix=f"['{time.strftime('%Y.%m.%d-%H:%M:%S')}'] [{t.ident}|{t.name}]\t"
|
|
55
|
+
if not hasPrefix:prefix=""
|
|
56
|
+
print(f"{prefix}\033[{type};{foregroundColor};{bg}m{msg}{err}\033[0m")
|
|
57
|
+
def log(msg):__log(msg)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def start_mark(msg,f="--",start:str="\r\n",end:str=">",num:int=36):
|
|
61
|
+
__log(start+f*num+ msg +f*num+end,hasPrefix=False)
|
|
62
|
+
def end_mark(msg,f="==",start:str="\r\n<",end:str="\r\n\r\n",num:int=36):
|
|
63
|
+
__log(start+f*num+ msg +f*num+end,hasPrefix=False)
|
|
64
|
+
|
|
65
|
+
def info(msg):__log(msg)
|
|
66
|
+
|
|
67
|
+
def succ(msg): __log(msg,7,32,40)
|
|
68
|
+
|
|
69
|
+
def warn(msg):__log(msg,7,33,40)
|
|
70
|
+
|
|
71
|
+
def err(msg,e=None):__log(msg,7,31,40,e)
|
|
72
|
+
|
|
73
|
+
def critical(msg):__log(msg,0,37,40)
|
|
74
|
+
|
|
75
|
+
if __name__ =="__main__":
|
|
76
|
+
logger.trace("123456asdf")
|
|
77
|
+
logger.success("*arg:{}{}\t\t**kwargs:'ab:{ab},cd:{cd}'","元数据1","元数据2",ab="字典数据1",cd="字典数据2")
|