Skip to content

Commit 70a5fab

Browse files
committed
[IMP] base: "--shell-file" option override for $PYTHONSTARTUP
The $PYTHONSTARTUP env variable can contain a python script that is used by Python shell at the start of any interactive session. - fix this feature from being broken in python and ptpython - include a new --shell-file=<filename> shell parameter to override the env variable $PYTHONSTARTUP - group the two shell parameters in a new options group - remove custom python shells' banners from the start of the session - shell options can now be saved in the configuration file. Python docs: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP Community PR: odoo/odoo#185075 task-4306704
1 parent 7d8368e commit 70a5fab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

content/developer/reference/cli.rst

+5
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ interaction with the :ref:`orm <reference/orm>` and its functionalities.
695695
By default, the shell is running in transaction mode. This means that any change made to the
696696
database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`.
697697

698+
699+
.. option:: --shell-file <init_script.py>
700+
Specify a python script to be run after the start of the shell.
701+
Overrides the environment variable PYTHONSTARTUP.
702+
698703
.. option:: --shell-interface (ipython|ptpython|bpython|python)
699704

700705
Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable

0 commit comments

Comments
 (0)