Skip to content

Commit 11fd330

Browse files
committed
取消get_current_hub修改
1 parent ae6bb53 commit 11fd330

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

hikyuu/hub.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -490,18 +490,14 @@ def get_part_name_list(self, hub=None, part_type=None):
490490

491491
@dbsession
492492
def get_current_hub(self, filename):
493-
"""用于在仓库part.py中获取当前所在的仓库名。如果找不到,将使用 "default" 仓库, 并给出告警。
494-
493+
"""用于在仓库part.py中获取当前所在的仓库名。
495494
示例: get_current_hub(__file__)
496495
"""
497496
abs_path = os.path.abspath(filename) # 当前文件的绝对路径
498497
path_parts = pathlib.Path(abs_path).parts
499498
local_base = path_parts[-4] if path_parts[-3] in ('pf', 'sys', 'ind', 'other') else path_parts[-5]
500499
hub_model = self._session.query(HubModel.name).filter_by(local_base=local_base).first()
501-
if hub_model is None:
502-
HubManager().logger.warning('未找到仓库,将使用 "default" 仓库!!!')
503-
hub_model = self._session.query(HubModel.name).filter_by(local_base='default').first()
504-
checkif(hub_model is None, local_base, HubNotFoundError)
500+
checkif(hub_model is None, local_base, HubNotFoundError)
505501
return hub_model.name
506502

507503

@@ -593,8 +589,7 @@ def get_part_name_list(hub=None, part_type=None):
593589

594590

595591
def get_current_hub(filename):
596-
"""用于在仓库part.py中获取当前所在的仓库名。如果找不到,将尝试使用 "default" 仓库, 并给出告警。
597-
592+
"""用于在仓库part.py中获取当前所在的仓库名。
598593
示例: get_current_hub(__file__)
599594
"""
600595
return HubManager().get_current_hub(filename)

0 commit comments

Comments
 (0)