[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Doubt about developing plugins for python applications

[BRAGA, Bruno, 2012-04-30]
> > > b) add current installation to python path (eg. /usr/share/program) so
> > the
> > > plugin can import the programlib packages/modules.
> >
> > plugins import programlib at runtime only, riht? Startup script is
> > adding . to the sys.path automaticall so plugins should see programlib,
> > no?
> I was worried about that because, depending on the system or installation,
> the location of the programlib may vary, right? So, I can not rely on
> leaving this sys.path hack hard-coded in the plugin, or can I?

What hack? Do not change anything in plugins or in the startup script.
Systems with public programlib already work and on those with private
dir, external plugins will have to be installed with
PYTHONPATH=/usr/share/program/ and --install-lib=/usr/share/program/ (in
debian/rules or in RPM spec file).

As upstream, you can make it easier for distro developers by stripping
'import programlib' from setup.py (so that they will not need to install
the program package and set apropriate PYTHONPATH)
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

Reply to: