Skip to content

Use default config file #9

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

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -91,3 +91,6 @@ ENV/
# Build artifacts
AUTHORS
CHANGELOG

# Idea files
.idea
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My 2cts : this should be in global gitignore of jetbrains users.

9 changes: 8 additions & 1 deletion flask_shell_ptpython.py
Original file line number Diff line number Diff line change
@@ -34,4 +34,11 @@ def shell_command():

ctx.update(app.make_shell_context())

embed(globals=ctx)
# Apply config file
def configure(repl):
path = os.path.join("~/.ptpython", 'config.py')
Copy link

@azmeuk azmeuk Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if os.path.exists(os.path.expanduser(path)):
from ptpython.repl import run_config
run_config(repl, path)

embed(globals=ctx, configure=configure)