This commit is contained in:
guanjihuan 2023-11-02 03:53:47 +08:00
parent 1ac616a583
commit e4cf9e1534
4 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# API Reference shows all functions in Guan package. The current version is guan-0.1.11 updated on November 02, 2023. # API Reference shows all functions in Guan package. The current version is guan-0.1.12 updated on November 02, 2023.
import guan import guan

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.1.11 version = 0.1.12
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.11 Version: 0.1.12
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.11, updated on November 02, 2023. # The current version is guan-0.1.12, updated on November 02, 2023.
# Installation: pip install --upgrade guan # Installation: pip install --upgrade guan
@ -4901,13 +4901,13 @@ def get_mac_address():
# Guan软件包的使用统计不涉及到用户的个人数据 # Guan软件包的使用统计不涉及到用户的个人数据
def statistics_of_guan_package(): def statistics_of_guan_package():
try: try:
import socket
import guan import guan
message_calling = guan.get_calling_function_name(layer=3) message_calling = guan.get_calling_function_name(layer=3)
current_version = get_current_version('guan')
if message_calling == '<module>': if message_calling == '<module>':
import socket
datetime_date = guan.get_date() datetime_date = guan.get_date()
datetime_time = guan.get_time() datetime_time = guan.get_time()
current_version = guan.get_current_version('guan')
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.settimeout(0.5) client_socket.settimeout(0.5)
client_socket.connect(('py.guanjihuan.com', 12345)) client_socket.connect(('py.guanjihuan.com', 12345))
@ -4918,7 +4918,7 @@ def statistics_of_guan_package():
client_socket2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket2.settimeout(0.5) client_socket2.settimeout(0.5)
client_socket2.connect(('py.guanjihuan.com', 12345)) client_socket2.connect(('py.guanjihuan.com', 12345))
mac_address = get_mac_address() mac_address = guan.get_mac_address()
send_mac_address = 'version_'+current_version+' MAC_address: '+mac_address+'\n' send_mac_address = 'version_'+current_version+' MAC_address: '+mac_address+'\n'
client_socket2.send(send_mac_address.encode()) client_socket2.send(send_mac_address.encode())
client_socket2.close() client_socket2.close()
@ -4952,8 +4952,9 @@ def get_current_version(package_name='guan'):
# Guan软件包升级提示 # Guan软件包升级提示
def notification_of_upgrade(): def notification_of_upgrade():
try: try:
latest_version = get_latest_version(package_name='guan', timeout=2) import guan
current_version = get_current_version('guan') latest_version = guan.get_latest_version(package_name='guan', timeout=2)
current_version = guan.get_current_version('guan')
if latest_version != None and current_version != None: if latest_version != None and current_version != None:
if latest_version != current_version: if latest_version != current_version:
print('提示:您当前使用的版本是 guan-'+current_version+',目前已经有最新版本 guan-'+latest_version+'。您可以通过以下命令对软件包进行升级pip install --upgrade guan') print('提示:您当前使用的版本是 guan-'+current_version+',目前已经有最新版本 guan-'+latest_version+'。您可以通过以下命令对软件包进行升级pip install --upgrade guan')