mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 03:48:19 +08:00
try fixed 界面无进度条
This commit is contained in:
parent
49fac34e20
commit
1c9d4d214e
@ -336,6 +336,8 @@ def import_data(connect, market, ktype, quotations, api, dest_dir, startDate=199
|
||||
h5file = open_h5file(dest_dir, market, ktype)
|
||||
|
||||
stock_list = get_stock_list(connect, market, quotations)
|
||||
if not stock_list:
|
||||
return 0
|
||||
|
||||
total = len(stock_list)
|
||||
for i, stock in enumerate(stock_list):
|
||||
|
@ -34,7 +34,7 @@ class ProgressBar:
|
||||
self.src = src
|
||||
|
||||
def __call__(self, cur, total):
|
||||
progress = (cur + 1) * 100 // total
|
||||
progress = (cur + 1) * 100 // total if total > 0 else 100
|
||||
# hku_info(f"{self.src.market} 分时数据: {progress}%")
|
||||
self.src.queue.put([self.src.task_name, self.src.market, 'TIME', progress, 0])
|
||||
|
||||
@ -53,6 +53,7 @@ class ImportPytdxTimeToH5:
|
||||
self.dest_dir = dest_dir
|
||||
self.max_days = int(max_days)
|
||||
|
||||
@hku_catch(trace=True, callback=lambda self: self.queue.put([self.task_name, self.market, 'TIME', None, 0]))
|
||||
def __call__(self):
|
||||
capture_multiprocess_all_logger(self.log_queue)
|
||||
count = 0
|
||||
|
@ -56,6 +56,7 @@ class ImportPytdxToH5:
|
||||
self.dest_dir = dest_dir
|
||||
self.startDatetime = start_datetime
|
||||
|
||||
@hku_catch(trace=True, callback=lambda self: self.queue.put([self.task_name, self.market, self.ktype, None, 0]))
|
||||
def __call__(self):
|
||||
capture_multiprocess_all_logger(self.log_queue)
|
||||
if self.config.getboolean('hdf5', 'enable', fallback=True):
|
||||
|
@ -53,6 +53,7 @@ class ImportPytdxTransToH5:
|
||||
self.dest_dir = dest_dir
|
||||
self.max_days = int(max_days)
|
||||
|
||||
@hku_catch(trace=True, callback=lambda self: self.queue.put([self.task_name, self.market, 'TRANS', None, 0]))
|
||||
def __call__(self):
|
||||
capture_multiprocess_all_logger(self.log_queue)
|
||||
count = 0
|
||||
|
Loading…
Reference in New Issue
Block a user