mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-03 04:17:58 +08:00
data tool (continue) fix 权息下载
This commit is contained in:
parent
6b37e7f662
commit
7bbd3ebd0c
@ -53,7 +53,7 @@ class ImportWeightToSqliteTask:
|
|||||||
self.queue.put([self.msg_name, '下载完成,正在校验是否存在更新...', 0, 0, 0])
|
self.queue.put([self.msg_name, '下载完成,正在校验是否存在更新...', 0, 0, 0])
|
||||||
new_md5 = old_md5 = hashlib.md5(buffer).hexdigest()
|
new_md5 = old_md5 = hashlib.md5(buffer).hexdigest()
|
||||||
dest_filename = self.dest_dir+'/weight.rar'
|
dest_filename = self.dest_dir+'/weight.rar'
|
||||||
old_md5 = new_md5
|
old_md5 = None
|
||||||
if os.path.exists(dest_filename):
|
if os.path.exists(dest_filename):
|
||||||
with open(dest_filename, 'rb') as oldfile:
|
with open(dest_filename, 'rb') as oldfile:
|
||||||
old_md5 = hashlib.md5(oldfile.read()).hexdigest()
|
old_md5 = hashlib.md5(oldfile.read()).hexdigest()
|
||||||
@ -64,7 +64,9 @@ class ImportWeightToSqliteTask:
|
|||||||
file.write(net_file.read())
|
file.write(net_file.read())
|
||||||
|
|
||||||
self.queue.put([self.msg_name, '下载完成,正在解压...', 0, 0, 0])
|
self.queue.put([self.msg_name, '下载完成,正在解压...', 0, 0, 0])
|
||||||
os.system('unrar x -o+ -inul {} {}'.format(dest_filename, self.dest_dir))
|
x = os.system('unrar x -o+ -inul {} {}'.format(dest_filename, self.dest_dir))
|
||||||
|
if x != 0:
|
||||||
|
raise Exception("无法找到unrar命令!")
|
||||||
|
|
||||||
self.queue.put([self.msg_name, '解压完毕,正在导入权息数据...', 0, 0, 0])
|
self.queue.put([self.msg_name, '解压完毕,正在导入权息数据...', 0, 0, 0])
|
||||||
total_count = qianlong_import_weight(connect, self.dest_dir + '/weight', 'SH')
|
total_count = qianlong_import_weight(connect, self.dest_dir + '/weight', 'SH')
|
||||||
|
Loading…
Reference in New Issue
Block a user