mdbq 1.7.6__tar.gz → 1.7.7__tar.gz
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-1.7.6 → mdbq-1.7.7}/PKG-INFO +1 -1
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/company/copysh.py +9 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/pbix/refresh_all.py +28 -3
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq.egg-info/PKG-INFO +1 -1
- {mdbq-1.7.6 → mdbq-1.7.7}/setup.py +1 -1
- {mdbq-1.7.6 → mdbq-1.7.7}/README.txt +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/__version__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/aggregation.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/df_types.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/mysql_types.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/optimize_data.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/aggregation/query_data.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/bdup/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/bdup/bdup.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/clean/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/clean/data_clean.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/company/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/config/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/config/get_myconf.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/config/products.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/config/set_support.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/config/update_conf.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/dataframe/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/dataframe/converter.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/log/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/log/mylogger.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mongo/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mongo/mongo.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mysql/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mysql/mysql.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mysql/s_query.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/mysql/year_month_day.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/other/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/other/porxy.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/other/pov_city.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/other/ua_sj.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/pbix/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/pbix/pbix_refresh.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq/spider/__init__.py +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq.egg-info/SOURCES.txt +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq.egg-info/dependency_links.txt +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/mdbq.egg-info/top_level.txt +0 -0
- {mdbq-1.7.6 → mdbq-1.7.7}/setup.cfg +0 -0
@@ -250,6 +250,15 @@ class TbFiles:
|
|
250
250
|
else:
|
251
251
|
print(f'{src} 所需同步的文件不存在,请检查:pd_list参数')
|
252
252
|
|
253
|
+
excel_path = os.path.join(self.share_path, 'EXCEL报表')
|
254
|
+
files = os.listdir(excel_path)
|
255
|
+
for file in files:
|
256
|
+
if file.endswith('.xlsx'):
|
257
|
+
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
258
|
+
print(f'正在刷新 excel: {file}')
|
259
|
+
r.refresh_excel2(excel_file=os.path.join(excel_path, file))
|
260
|
+
time.sleep(10)
|
261
|
+
|
253
262
|
self.before_max_time = self.check_change() # 重置值, 避免重复同步
|
254
263
|
|
255
264
|
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
@@ -17,7 +17,7 @@ class RefreshAll:
|
|
17
17
|
def __init__(self):
|
18
18
|
self.my_conf = os.path.join(set_support.SetSupport(dirname='support').dirname, '.my_conf')
|
19
19
|
self.pbix_path = os.path.join(set_support.SetSupport(dirname='support').dirname, 'ref_list.txt')
|
20
|
-
self.excel_path = os.path.join(set_support.SetSupport(dirname='support').dirname, '
|
20
|
+
self.excel_path = os.path.join(set_support.SetSupport(dirname='support').dirname, 'ref_list.txt')
|
21
21
|
self.run_py_path = 'run_py'
|
22
22
|
self.procname = 'PBIDesktop.exe'
|
23
23
|
|
@@ -84,6 +84,31 @@ class RefreshAll:
|
|
84
84
|
except Exception as e:
|
85
85
|
print(e)
|
86
86
|
|
87
|
+
def refresh_excel2(self, excel_file):
|
88
|
+
# 刷新 excel
|
89
|
+
if excel_file.endswith('.xlsx'):
|
90
|
+
try:
|
91
|
+
print(f'正在刷新 >>>{excel_file}')
|
92
|
+
xlapp = win32com.client.Dispatch('Excel.Application') # 创建Excel程序App
|
93
|
+
xlapp.Visible = False # 窗口是否可见
|
94
|
+
xlapp.DisplayAlerts = False # 是否显示警告信息
|
95
|
+
wb = xlapp.Workbooks.Open(excel_file)
|
96
|
+
conjuncts = wb.Connections.Count # 统计工作簿含有多少外部链接
|
97
|
+
if conjuncts == 0:
|
98
|
+
wb.Close(SaveChanges=False)
|
99
|
+
xlapp.Quit()
|
100
|
+
else:
|
101
|
+
time.sleep(2)
|
102
|
+
wb.RefreshAll()
|
103
|
+
xlapp.CalculateUntilAsyncQueriesDone()
|
104
|
+
time.sleep(2)
|
105
|
+
wb.Save()
|
106
|
+
wb.Close(SaveChanges=True)
|
107
|
+
xlapp.Quit()
|
108
|
+
print('文件刷新 >>>' + excel_file)
|
109
|
+
except Exception as e:
|
110
|
+
print(e)
|
111
|
+
|
87
112
|
def pbi(self, path, _timeout=300):
|
88
113
|
"""
|
89
114
|
这是原本属于独立的库模块: pbix_refresh
|
@@ -146,7 +171,7 @@ class RefreshAll:
|
|
146
171
|
|
147
172
|
|
148
173
|
if __name__ == '__main__':
|
149
|
-
|
174
|
+
r = RefreshAll()
|
150
175
|
# r.refresh_pbix()
|
151
|
-
|
176
|
+
r.refresh_excel()
|
152
177
|
pass
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|