Ticket #2608 (closed patch: fixed)

Opened 3 years ago

Last modified 3 years ago

Add python plugin paths

Reported by: ccrook Owned by: borysiasty
Priority: minor: annoyance Milestone: Version 1.5.0
Component: Python plugins and bindings Version: Trunk
Keywords: python plugin loading Cc:
Platform Version: 1.5 Platform: All
Must Fix for Release: No Awaiting user input: no

Description

This proposed patch to qgis.utils modifies the plugin loading to allow users to define additional plugin path locations (for example shared plugin folders). It allows these paths to be defined by a QGIS_PYTHONPATH environment variable, which can hold multiple paths separated by a semicolon. In each path it will look for a plugins folder, and in that each folder containing an init.py* will be treated as a plugin module.

Attachments

utils_py.diff Download (1.6 KB) - added by ccrook 3 years ago.

Change History

Changed 3 years ago by wonder

Chris,

may I suggest you to use e.g. QGIS_PLUGINPATH - that would contain path(s) directly to the directory with plugins. Because QGIS_PYTHONPATH gives impression that one can override the whole python path and not just path for plugins. So, instead of QGIS_PYTHONPATH/plugins I suggest QGIS_PLUGINPATH

Martin

Changed 3 years ago by ccrook

Changed 3 years ago by ccrook

Hi Martin

Good idea - I've updated the patch to do this. This does mean that I've changed the findPlugin function - it now looks in the directory it is given, rather than in the plugins subdirectory of that. However as far as I can see it isn't used anywhere else, so I think that this should be Ok.

Chris

Changed 3 years ago by wonder

  • status changed from new to closed
  • resolution set to fixed

Applied in r13236 with few modifications

Note: See TracTickets for help on using tickets.