Skip to content

Commit

Permalink
hub 中的 prtflo 更名为 pf
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed Apr 3, 2024
1 parent a792c98 commit 8c12727
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hikyuu/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def import_part_to_db(self, hub_model):
'sg': 'part/sg',
'sp': 'part/sp',
'st': 'part/st',
'prtflo': 'prtflo',
'pf': 'pf',
'sys': 'sys',
'ind': 'ind',
'other': 'other',
Expand All @@ -356,7 +356,7 @@ def import_part_to_db(self, hub_model):
if (not entry.name.startswith('.')) and entry.is_dir() and (entry.name != "__pycache__"):
# 计算实际的导入模块名
module_name = '{}.part.{}.{}.part'.format(base_local, part, entry.name) if part not in (
'prtflo', 'sys', 'ind', 'other'
'pf', 'sys', 'ind', 'other'
) else '{}.{}.{}.part'.format(base_local, part, entry.name)
# 导入模块
Expand All @@ -375,7 +375,7 @@ def import_part_to_db(self, hub_model):
continue
name = '{}.{}.{}'.format(hub_model.name, part, entry.name) if part not in (
'prtflo', 'sys', 'ind', 'other'
'pf', 'sys', 'ind', 'other'
) else '{}.{}.{}'.format(hub_model.name, part, entry.name)
try:
Expand Down Expand Up @@ -406,7 +406,7 @@ def get_part(self, name, **kwargs):
name_parts = name.split('.')
checkif(
len(name_parts) < 2
or (name_parts[-2] not in ('af', 'cn', 'ev', 'mf', 'mm', 'pg', 'se', 'sg', 'sp', 'st', 'prtflo', 'sys', 'ind', 'other')),
or (name_parts[-2] not in ('af', 'cn', 'ev', 'mf', 'mm', 'pg', 'se', 'sg', 'sp', 'st', 'pf', 'sys', 'ind', 'other')),
name, PartNameError
)
Expand Down Expand Up @@ -496,7 +496,7 @@ def get_current_hub(self, filename):
"""
abs_path = os.path.abspath(filename) # 当前文件的绝对路径
path_parts = pathlib.Path(abs_path).parts
local_base = path_parts[-4] if path_parts[-3] in ('prtflo', 'sys', 'ind', 'other') else path_parts[5]
local_base = path_parts[-4] if path_parts[-3] in ('pf', 'sys', 'ind', 'other') else path_parts[5]
hub_model = self._session.query(HubModel.name).filter_by(local_base=local_base).first()
checkif(hub_model is None, local_base, HubNotFoundError)
return hub_model.name
Expand Down

0 comments on commit 8c12727

Please sign in to comment.