add 'globals' instead of overwriting the default (#3773)

pull/3815/head
Mike Fährmann 2 years ago
parent dcb8af659a
commit a1ca2404f9
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -4740,15 +4740,13 @@ Type
Example
* ``"~/.local/share/gdl-globals.py"``
* ``"gdl-globals"``
Default
The ``GLOBALS`` dict in
`util.py <../gallery_dl/util.py>`__
Description
Path to or name of an
`importable <https://docs.python.org/3/reference/import.html>`__
Python module whose namespace gets used as an alternative
|globals parameter|__
for compiled Python expressions.
| Path to or name of an
`importable <https://docs.python.org/3/reference/import.html>`__
Python module,
| whose namespace,
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
.. __: https://docs.python.org/3/library/functions.html#eval

@ -120,7 +120,7 @@ def main():
# eval globals
path = config.get((), "globals")
if path:
util.GLOBALS = util.import_file(path).__dict__
util.GLOBALS.update(util.import_file(path).__dict__)
# loglevels
output.configure_logging(args.loglevel)

Loading…
Cancel
Save