Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 给默认plan_root加入examples目录 #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions autowsgr/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,17 @@ def __post_init__(self) -> None:
object.__setattr__(self, 'default_plan_root', os.path.join(DATA_ROOT, 'plans'))
if self.plan_root is None:
local_plan_root = os.path.join(os.getcwd(), 'plans')
example_plan_root = os.path.join(
os.path.dirname(os.path.dirname(DATA_ROOT)),
'examples',
'plans',
)
if os.path.exists(local_plan_root):
object.__setattr__(self, 'plan_root', local_plan_root)
print(f'使用脚本运行目录的plans: {local_plan_root}')
elif os.path.exists(example_plan_root):
object.__setattr__(self, 'plan_root', example_plan_root)
print(f'使用examples目录的plans: {example_plan_root}')
else:
object.__setattr__(self, 'plan_root', self.default_plan_root)
print(f'使用默认plans: {self.default_plan_root}')
Expand Down