add 'globals' instead of overwriting the default (#3773)
This commit is contained in:
@@ -4740,15 +4740,13 @@ Type
|
|||||||
Example
|
Example
|
||||||
* ``"~/.local/share/gdl-globals.py"``
|
* ``"~/.local/share/gdl-globals.py"``
|
||||||
* ``"gdl-globals"``
|
* ``"gdl-globals"``
|
||||||
Default
|
|
||||||
The ``GLOBALS`` dict in
|
|
||||||
`util.py <../gallery_dl/util.py>`__
|
|
||||||
Description
|
Description
|
||||||
Path to or name of an
|
| Path to or name of an
|
||||||
`importable <https://docs.python.org/3/reference/import.html>`__
|
`importable <https://docs.python.org/3/reference/import.html>`__
|
||||||
Python module whose namespace gets used as an alternative
|
Python module,
|
||||||
|globals parameter|__
|
| whose namespace,
|
||||||
for compiled Python expressions.
|
in addition to the ``GLOBALS`` dict in `util.py <../gallery_dl/util.py>`__,
|
||||||
|
gets used as |globals parameter|__ for compiled Python expressions.
|
||||||
|
|
||||||
.. |globals parameter| replace:: ``globals`` parameter
|
.. |globals parameter| replace:: ``globals`` parameter
|
||||||
.. __: https://docs.python.org/3/library/functions.html#eval
|
.. __: https://docs.python.org/3/library/functions.html#eval
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ def main():
|
|||||||
# eval globals
|
# eval globals
|
||||||
path = config.get((), "globals")
|
path = config.get((), "globals")
|
||||||
if path:
|
if path:
|
||||||
util.GLOBALS = util.import_file(path).__dict__
|
util.GLOBALS.update(util.import_file(path).__dict__)
|
||||||
|
|
||||||
# loglevels
|
# loglevels
|
||||||
output.configure_logging(args.loglevel)
|
output.configure_logging(args.loglevel)
|
||||||
|
|||||||
Reference in New Issue
Block a user