Skip to content
Open
Show file tree
Hide file tree
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 click_odoo/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ class Shell:

@classmethod
def python(cls, local_vars):
if os.getenv("PYTHONSTARTUP"):
# If PYTHONSTARTUP is defined, run it.
startup_file = os.getenv("PYTHONSTARTUP")
if os.path.isfile(startup_file):
with open(startup_file) as f:
startup = f.read()
exec(startup, local_vars)

console = code.InteractiveConsole(locals=local_vars)
import readline
import rlcompleter # noqa
Expand Down
1 change: 1 addition & 0 deletions newsfragments/74.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Honor PYTHONSTARTUP environment variable the same way the python repl does.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ build-backend = "setuptools.build_meta"
issue_format = "`#{issue} <https://github.com/acsone/click-odoo/issues/{issue}>`_"
directory = "newsfragments/"
filename = "CHANGES.rst"

[dependency-groups]
dev = [
"towncrier>=25.8.0",
]
Loading