Skip to content

Commit

Permalink
update hub.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed Jan 30, 2024
1 parent 2487851 commit 8aafe89
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hikyuu/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ def build_hub(self, name, cmd='buildall'):
"""
hub_model = self._session.query(HubModel).filter_by(name=name).first()
checkif(hub_model is None, '指定的仓库({})不存在!'.format(name))
os.system(f"python3 {hub_model.local}/setup.py {cmd}")
if sys.platform == 'win32':
os.system(f"python {hub_model.local}/setup.py {cmd}")
else:
os.system(f"python3 {hub_model.local}/setup.py {cmd}")
@dbsession
def remove_hub(self, name):
Expand Down Expand Up @@ -358,10 +361,10 @@ def import_part_to_db(self, hub_model):
try:
part_module = importlib.import_module(module_name)
except ModuleNotFoundError:
self.logger.error('缺失 part.py 文件, 位置:"{}"!'.format(entry.path))
self.logger.error('{} 缺失 part.py 文件, 位置:"{}"!'.format(module_name, entry.path))
continue
except:
self.logger.error('无法导入该文件: {}'.format(entry.path))
self.logger.error('{} 无法导入该文件: {}'.format(module_name, entry.path))
continue
module_vars = vars(part_module)
Expand Down Expand Up @@ -602,6 +605,7 @@ def get_current_hub(filename):
'add_local_hub',
'update_hub',
'remove_hub',
'build_hub',
'get_part',
'get_hub_path',
'get_part_info',
Expand Down

0 comments on commit 8aafe89

Please sign in to comment.