mdbq 2.2.0__py3-none-any.whl → 2.2.2__py3-none-any.whl
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.
- mdbq/company/copysh.py +2 -1
- mdbq/pbix/refresh_all.py +13 -7
- {mdbq-2.2.0.dist-info → mdbq-2.2.2.dist-info}/METADATA +1 -1
- {mdbq-2.2.0.dist-info → mdbq-2.2.2.dist-info}/RECORD +6 -6
- {mdbq-2.2.0.dist-info → mdbq-2.2.2.dist-info}/WHEEL +0 -0
- {mdbq-2.2.0.dist-info → mdbq-2.2.2.dist-info}/top_level.txt +0 -0
mdbq/company/copysh.py
CHANGED
@@ -255,9 +255,10 @@ class TbFiles:
|
|
255
255
|
# 刷新共享位置的指定文件/文件夹
|
256
256
|
excel_path = os.path.join(self.share_path, 'EXCEL报表')
|
257
257
|
files = os.listdir(excel_path)
|
258
|
+
files = [f'{excel_path}\\{item}' for item in files if item.endswith('.xlsx') or item.endswith('.xls')]
|
258
259
|
r = refresh_all.RefreshAll()
|
259
260
|
for file in files:
|
260
|
-
if '~' in file or 'DS_Store' in file or 'baidu' in file or 'xunlei' in
|
261
|
+
if '~' in file or 'DS_Store' in file or 'baidu' in file or 'xunlei' in file:
|
261
262
|
continue
|
262
263
|
if file.endswith('.xlsx') or file.endswith('.xls'):
|
263
264
|
r.refresh_excel(file=file)
|
mdbq/pbix/refresh_all.py
CHANGED
@@ -4,6 +4,7 @@ import win32com.client
|
|
4
4
|
import time
|
5
5
|
import psutil
|
6
6
|
from pywinauto.application import Application
|
7
|
+
import datetime
|
7
8
|
import warnings
|
8
9
|
# from mdbq.config import set_support
|
9
10
|
|
@@ -21,7 +22,8 @@ class RefreshAll:
|
|
21
22
|
def refresh_pbix(self, file):
|
22
23
|
# 刷新 PBI
|
23
24
|
if not os.path.isfile(file):
|
24
|
-
|
25
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
|
26
|
+
print(f'{now}{file} -> 文件不存在')
|
25
27
|
return
|
26
28
|
# with open(self.pbix_path, 'r', encoding='utf-8') as f:
|
27
29
|
# content = f.readlines()
|
@@ -37,18 +39,21 @@ class RefreshAll:
|
|
37
39
|
"""刷新程序"""
|
38
40
|
for es in range(4):
|
39
41
|
try:
|
40
|
-
|
42
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
|
43
|
+
print(f'{now}正在刷新 >>>{file}')
|
41
44
|
self.pbi(path=file)
|
42
|
-
print('文件已刷新!')
|
45
|
+
# print('文件已刷新!')
|
43
46
|
break
|
44
47
|
except Exception as e:
|
45
48
|
print(e)
|
46
|
-
|
49
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
|
50
|
+
print(f'{now}报错的文件 >>>' + file + ' >> ' + str(es + 1))
|
47
51
|
|
48
52
|
def refresh_excel(self, file):
|
49
53
|
# 刷新 excel
|
50
54
|
if not os.path.isfile(file):
|
51
|
-
|
55
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
|
56
|
+
print(f'{now}{file} -> 文件不存在')
|
52
57
|
return
|
53
58
|
if not file.endswith('.xlsx') and not file.endswith('.xls'):
|
54
59
|
return
|
@@ -61,7 +66,8 @@ class RefreshAll:
|
|
61
66
|
# if not excel_list:
|
62
67
|
# return
|
63
68
|
try:
|
64
|
-
|
69
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S ')
|
70
|
+
print(f'{now}正在刷新 >>>{file}')
|
65
71
|
xlapp = win32com.client.Dispatch('Excel.Application') # 创建Excel程序App
|
66
72
|
xlapp.Visible = False # 窗口是否可见
|
67
73
|
xlapp.DisplayAlerts = False # 是否显示警告信息
|
@@ -78,7 +84,7 @@ class RefreshAll:
|
|
78
84
|
wb.Save()
|
79
85
|
wb.Close(SaveChanges=True)
|
80
86
|
xlapp.Quit()
|
81
|
-
print('文件已刷新!')
|
87
|
+
# print('文件已刷新!')
|
82
88
|
except Exception as e:
|
83
89
|
print(file, e)
|
84
90
|
|
@@ -11,7 +11,7 @@ mdbq/bdup/bdup.py,sha256=LAV0TgnQpc-LB-YuJthxb0U42_VkPidzQzAagan46lU,4234
|
|
11
11
|
mdbq/clean/__init__.py,sha256=A1d6x3L27j4NtLgiFV5TANwEkLuaDfPHDQNrPBbNWtU,41
|
12
12
|
mdbq/clean/data_clean.py,sha256=ZJOTT0sNWP85x4pJl39UZBwN4Bnf8Ao-iVOJNiiRPEE,103996
|
13
13
|
mdbq/company/__init__.py,sha256=qz8F_GsP_pMB5PblgJAUAMjasuZbOEp3qQOCB39E8f0,21
|
14
|
-
mdbq/company/copysh.py,sha256=
|
14
|
+
mdbq/company/copysh.py,sha256=LYMONSIX2EoPyDQqFODRfIZ2TJtNQBKEeWXCbawTraI,19048
|
15
15
|
mdbq/company/home_sh.py,sha256=42CZ2tZIXHLl2mOl2gk2fZnjH2IHh1VJ1s3qHABjonY,18021
|
16
16
|
mdbq/config/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
17
17
|
mdbq/config/get_myconf.py,sha256=cmNvsyoNa0RbZ9FOTjSd3jyyGwkxjUo0phvdHbGlrms,6010
|
@@ -35,10 +35,10 @@ mdbq/other/sku_picture.py,sha256=vHHnajaS6Nz2sEduENihEUY_ZMhyBuQO7WuzrXSDSXM,481
|
|
35
35
|
mdbq/other/ua_sj.py,sha256=JuVYzc_5QZ9s_oQSrTHVKkQv4S_7-CWx4oIKOARn_9U,22178
|
36
36
|
mdbq/pbix/__init__.py,sha256=Trtfaynu9RjoTyLLYBN2xdRxTvm_zhCniUkVTAYwcjo,24
|
37
37
|
mdbq/pbix/pbix_refresh.py,sha256=JUjKW3bNEyoMVfVfo77UhguvS5AWkixvVhDbw4_MHco,2396
|
38
|
-
mdbq/pbix/refresh_all.py,sha256=
|
38
|
+
mdbq/pbix/refresh_all.py,sha256=viOlLCmz9zg61Q2nzjgl8dChfQxnxRd1A_jmQMb2oDM,5918
|
39
39
|
mdbq/pbix/refresh_all_old.py,sha256=_pq3WSQ728GPtEG5pfsZI2uTJhU8D6ra-htIk1JXYzw,7192
|
40
40
|
mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
|
41
|
-
mdbq-2.2.
|
42
|
-
mdbq-2.2.
|
43
|
-
mdbq-2.2.
|
44
|
-
mdbq-2.2.
|
41
|
+
mdbq-2.2.2.dist-info/METADATA,sha256=-_fzEPy1JZTOKPkqXghaBcg7ERBf8HzN3G3KOuX6Ino,245
|
42
|
+
mdbq-2.2.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
43
|
+
mdbq-2.2.2.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
|
44
|
+
mdbq-2.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|