0.1.21 修复循环调用时软件包的过量统计

This commit is contained in:
guanjihuan 2023-11-07 17:25:44 +08:00
parent 3c0bacd8c8
commit b25f573b20
4 changed files with 37 additions and 32 deletions

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.1.20 version = 0.1.21
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.20 Version: 0.1.21
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

@ -15,6 +15,5 @@ from .file_processing import *
from .data_processing import * from .data_processing import *
import guan import guan
rand_number = guan.get_random_number(start=1, end=10)
if rand_number == 5:
guan.notification_of_upgrade() guan.notification_of_upgrade()
global_variable_of_first_guan_package_calling = True

View File

@ -385,6 +385,9 @@ def get_mac_address():
# Guan软件包的使用统计不涉及到用户的个人数据 # Guan软件包的使用统计不涉及到用户的个人数据
def statistics_of_guan_package(): def statistics_of_guan_package():
global global_variable_of_first_guan_package_calling
if global_variable_of_first_guan_package_calling == True:
global_variable_of_first_guan_package_calling = False
try: try:
import guan import guan
message_calling = guan.get_calling_function_name(layer=3) message_calling = guan.get_calling_function_name(layer=3)
@ -430,6 +433,9 @@ def get_current_version(package_name='guan'):
# Guan软件包升级提示 # Guan软件包升级提示
def notification_of_upgrade(timeout=0.5): def notification_of_upgrade(timeout=0.5):
import guan
rand_number = guan.get_random_number(start=1, end=10)
if rand_number == 5:
try: try:
import guan import guan
latest_version = guan.get_latest_version(package_name='guan', timeout=timeout) latest_version = guan.get_latest_version(package_name='guan', timeout=timeout)