OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
163 stars 89 forks source link

NameError when libsecret GIR bindings are not installed #115

Closed jnumm closed 6 years ago

jnumm commented 6 years ago

Hello,

I'm trying the latest git revision on Debian 9.5. I configured with --prefix=$HOME/system-config-printer, ran make install, then tried to launch the application.

Traceback (most recent call last):
  File "/home/juhani/system-config-printer/share/system-config-printer/system-config-printer.py", line 84, in <module>
    import jobviewer
  File "/home/juhani/system-config-printer/share/system-config-printer/jobviewer.py", line 76, in <module>
    NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,
NameError: name 'Secret' is not defined

This error goes away when I install the Debian package gir1.2-secret-1. it looks like jobviewer.py uses the name Secret even when gi.repository could not provide it.

If libsecret is not meant to be optional, then the import inside try in jobviewer.py:56 is misleading. On the other hand, if libsecret indeed is optional, Secret should not be used without checking the variable USE_SECRET.

zdohnal commented 6 years ago

Hi Juhani, thank you for reporting this issue! The latest commit 42d95b7 should take care of it - the previous module used there - libgnome-keyring - was optional too, so it should stay optional.