This commit is contained in:
guanjihuan 2023-11-02 02:01:22 +08:00
parent f17b0d1902
commit 4f36df09a7
4 changed files with 22 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# API Reference shows all functions in Guan package. The current version is guan-0.1.7 updated on November 01, 2023. # API Reference shows all functions in Guan package. The current version is guan-0.1.8 updated on November 02, 2023.
import guan import guan
@ -990,6 +990,9 @@ datetime_date = guan.get_date(bar=True)
# 获取当前时间字符串 # 获取当前时间字符串
datetime_time = guan.get_time() datetime_time = guan.get_time()
# 获取MAC地址
mac_address = guan.get_mac_address()
# Guan软件包的使用统计不涉及到用户的个人数据 # Guan软件包的使用统计不涉及到用户的个人数据
guan.statistics_of_guan_package() guan.statistics_of_guan_package()

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.1.7 version = 0.1.8
author = guanjihuan author = guanjihuan
author_email = guanjihuan@163.com author_email = guanjihuan@163.com
description = An open source python package description = An open source python package

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: guan Name: guan
Version: 0.1.7 Version: 0.1.8
Summary: An open source python package Summary: An open source python package
Home-page: https://py.guanjihuan.com Home-page: https://py.guanjihuan.com
Author: guanjihuan Author: guanjihuan

View File

@ -1,6 +1,6 @@
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com/about (Ji-Huan Guan, 关济寰). The primary location of this package is on website https://py.guanjihuan.com. GitHub link: https://github.com/guanjihuan/py.guanjihuan.com. # Guan is an open-source python package developed and maintained by https://www.guanjihuan.com/about (Ji-Huan Guan, 关济寰). The primary location of this package is on website https://py.guanjihuan.com. GitHub link: https://github.com/guanjihuan/py.guanjihuan.com.
# The current version is guan-0.1.7, updated on November 01, 2023. # The current version is guan-0.1.8, updated on November 02, 2023.
# Installation: pip install --upgrade guan # Installation: pip install --upgrade guan
@ -4891,6 +4891,13 @@ def get_time():
datetime_time = datetime.datetime.now().strftime('%H:%M:%S') datetime_time = datetime.datetime.now().strftime('%H:%M:%S')
return datetime_time return datetime_time
# 获取MAC地址
def get_mac_address():
import uuid
mac_address = uuid.UUID(int=uuid.getnode()).hex[-12:].upper()
mac_address = '-'.join([mac_address[i:i+2] for i in range(0, 11, 2)])
return mac_address
# Guan软件包的使用统计不涉及到用户的个人数据 # Guan软件包的使用统计不涉及到用户的个人数据
def statistics_of_guan_package(): def statistics_of_guan_package():
try: try:
@ -4904,8 +4911,15 @@ def statistics_of_guan_package():
client_socket.settimeout(0.5) client_socket.settimeout(0.5)
client_socket.connect(('py.guanjihuan.com', 12345)) client_socket.connect(('py.guanjihuan.com', 12345))
message = guan.get_calling_function_name(layer=2)+"\n" message = guan.get_calling_function_name(layer=2)+"\n"
send_message = datetime_date + ' ' + datetime_time + ' version_0.1.7 guan.' + message send_message = datetime_date + ' ' + datetime_time + ' version_0.1.8 guan.' + message
client_socket.send(send_message.encode()) client_socket.send(send_message.encode())
client_socket.close() client_socket.close()
client_socket2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket2.settimeout(0.5)
client_socket2.connect(('py.guanjihuan.com', 12345))
mac_address = get_mac_address()
send_mac_address = 'version_0.1.8 MAC_address: '+mac_address
client_socket2.send(send_mac_address.encode())
client_socket2.close()
except: except:
pass pass