diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index fdfa439..a018e5b 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.36 +version = 0.1.37 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index def8d3a..0a2bac4 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: guan -Version: 0.1.36 +Version: 0.1.37 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/others.py b/PyPI/src/guan/others.py index a615781..a30d472 100644 --- a/PyPI/src/guan/others.py +++ b/PyPI/src/guan/others.py @@ -7,9 +7,11 @@ def get_date(bar=True): return datetime_date # 获取当前时间字符串 -def get_time(): +def get_time(colon=True): import datetime datetime_time = datetime.datetime.now().strftime('%H:%M:%S') + if colon==False: + datetime_time = datetime_time.replace(':', '') return datetime_time # 获取MAC地址 @@ -19,6 +21,12 @@ def get_mac_address(): mac_address = '-'.join([mac_address[i:i+2] for i in range(0, 11, 2)]) return mac_address +# 获取函数的源码 +def get_function_source(function_name): + import inspect + function_source = inspect.getsource(function_name) + return function_source + # 获取调用本函数的函数名 def get_calling_function_name(layer=1): import inspect @@ -47,6 +55,7 @@ def statistics_of_guan_package(): client_socket.connect(('socket.guanjihuan.com', 12345)) mac_address = guan.get_mac_address() message = { + 'server': 'py.guanjihuan.com', 'date': datetime_date, 'time': datetime_time, 'version': current_version,