[GRASS-git] [OSGeo/grass] b0a00b: grass.pygrass: Lazy load list of commands for modu...
Vaclav Petras
noreply at github.com
Sat May 25 18:17:41 PDT 2024
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: b0a00b401b27a626722dfd4cbae425432dfce437
https://github.com/OSGeo/grass/commit/b0a00b401b27a626722dfd4cbae425432dfce437
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2024-05-25 (Sat, 25 May 2024)
Changed paths:
M python/grass/pygrass/modules/shortcuts.py
M python/grass/pygrass/modules/tests/grass_pygrass_grid_test.py
Log Message:
-----------
grass.pygrass: Lazy load list of commands for module shortcuts (#3688)
Importing _grass.pygrass.modules_ required the list to be loaded because the _shortcuts_ module is loaded by the _modules_ module. Now the list is loaded only when the _dir_ function is called for the first time.
This is using the technique from grass init file for lazy loading translations.
This allows grass.pygrass.modules to be imported without an active session, so this simplifies the GridModule tests (and its imports in general).
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list