Bug 219751

Summary: Printer Settings in System settings in KDE doesn't work
Product: [Plasma] system-config-printer-kde Reporter: Tom Kijas <t.kijas>
Component: generalAssignee: Jonathan Riddell <jr>
Status: RESOLVED FIXED    
Severity: normal CC: cannewilson, colin.thomson, jajaxor, kde-bugs, kevin.kofler, keyser7777, raphoun, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: [Proposed patch] combobox_dict issue

Description Tom Kijas 2009-12-22 22:33:37 UTC
Version:           1.0 (using 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2)), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.31-11-generic

Few days I updated from KDE4.3.4 to KDE4.4 beta and since that time, I have no chance to change printer settings in system settings. It shows me "The service 'Printer Configuration' does not provide an interface 'KCModule' with keyword 'system-config-printer-kde/system-config-printer-kde.py'The factory does not support creating components of the specified type.

Possible reasons:
-An error occured during your last KDE upgrade leaving an orphaned control module
-You have old third party modules lying around.

Check these points carefully and try to remove the module mentioned in the error message. If this fails, consider contacting your distributor or packager." Please help me what to do with that. Thanks
Comment 1 Tom Kijas 2009-12-22 22:36:46 UTC
I must also say that I tried to do sudo apt-get autoremove and sudo aptitude autoclean but nothing helped. I also uninstalled and reinstalled the system-config-printer-kde...
Comment 2 Martin Kho 2009-12-29 12:08:27 UTC
Hi,

I see the same behaviour on a full updated Fedora rawhide (KDE 4.3.85). Running from the command prompt shows the following messages:

[martin@ps-1866 ~]$ systemsettings(2221)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule: Module not already loaded, loading module  "Printer Configuration"  from library  "kpythonpluginfactory"  using symbol  "kpythonpluginfactory"
systemsettings(2221)/python (plugin) KPythonPluginFactory::KPythonPluginFactory: KPythonPluginFactory::KPythonPluginFactory()
systemsettings(2221)/python (plugin) KPythonPluginFactory::initialize: Initializing Python interpreter.
systemsettings(2221)/python (plugin) KPythonPluginFactory::initialize: Succesfully initialized Python interpreter.
systemsettings(2221)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  KCModule
systemsettings(2221)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  "system-config-printer-kde/system-config-printer-kde.py"
systemsettings(2221)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py"
systemsettings(2221)/python (plugin): Error while running factory function for Python plugin:  "system-config-printer-kde/system-config-printer-kde.py"
Traceback (most recent call last):
  File "<string>", line 18, in kpythonpluginfactory_bridge
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4003, in CreatePlugin
    kcm = u.makeui(component_data, widget_parent)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 216, in makeui
    self.ui.btnJOResetCopies),
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 117, in __init__
    self.reinit (None)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 155, in reinit
    self.set_widget_value (self.system_default)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 178, in set_widget_value
    raise NotImplemented
TypeError: exceptions must be classes or instances, not NotImplementedType
Comment 3 keyser7777 2010-01-09 20:10:23 UTC
Hi,

I've just updated to (KDE 4.3.85 (KDE 4.4 Beta2)) and I've encountered the same error described.

I'm using Ubuntu 9.10 and packages from kubuntu-ppa/beta.

Here is the output when running systemsettings from console:

                                                                    
keyser@supertramp:~$ systemsettings(4002)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule: Module not already loaded, loading module  "Printer Configuration"  from library  "kpythonpluginfactory"  using symbol  "kpythonpluginfactory"                                                                    
systemsettings(4002)/python (plugin) KPythonPluginFactory::KPythonPluginFactory: KPythonPluginFactory::KPythonPluginFactory()                                                                                 
systemsettings(4002)/python (plugin) KPythonPluginFactory::initialize: Initializing Python interpreter.
systemsettings(4002)/python (plugin) KPythonPluginFactory::initialize: Succesfully initialized Python interpreter.                                                                                            
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  KCModule
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  "system-config-printer-kde/system-config-printer-kde.py"
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py"
systemsettings(4002)/python (plugin): Error while running factory function for Python plugin:  "system-config-printer-kde/system-config-printer-kde.py"
Traceback (most recent call last):
  File "<string>", line 18, in kpythonpluginfactory_bridge
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4004, in CreatePlugin
    kcm = u.makeui(component_data, widget_parent)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 217, in makeui
    self.ui.btnJOResetCopies),
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 117, in __init__
    self.reinit (None)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 155, in reinit
    self.set_widget_value (self.system_default)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 178, in set_widget_value
    raise NotImplemented
TypeError: exceptions must be classes or instances, not NotImplementedType
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  KCModule
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  ""
systemsettings(4002)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/home/keyser/.kde/share/apps/"
systemsettings(4002)/python (plugin): Failed to import module
systemsettings(4002)/kcontrol KCModuleLoader::loadModule: This module has no valid entry symbol at all. The reason could be that it's still using K_EXPORT_COMPONENT_FACTORY with a custom X-KDE-FactoryName which is not supported anymore
Comment 4 keyser7777 2010-01-10 00:40:42 UTC
Hi,

I've just updated to (KDE 4.3.90 (KDE 4.4 RC1)) and the error is still there.
Comment 5 Raphaƫl G. 2010-01-16 21:03:28 UTC
Error still here with KDE 4.3.90 on Kubuntu Karmic
Comment 6 jajaX 2010-01-16 23:58:28 UTC
Hi !

same problem for for me (kubuntu 9.10, KDE 4.4 rc1)
Comment 7 Luca Beltrame 2010-01-24 23:34:33 UTC
SVN commit 1079747 by lbeltrame:

Fix running with Python versions greater than 2.5. NotImplemented is a constant, not an Exception, so the code should return rather than raise. This should have no impact on Python  2.5 or older.
BUG: 219751


 M  +6 -6      options.py  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1079747
Comment 8 Luca Beltrame 2010-01-25 08:05:31 UTC
SVN commit 1079837 by lbeltrame:

Forward port of r1079747.

Fix running with Python versions greater than 2.5. NotImplemented is a constant, not 
an Exception, so the code should return rather than raise. This should have no impact 
on Python  2.5 or older.

CCBUG: 219751


 M  +6 -6      options.py  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1079837
Comment 9 Martin Kho 2010-01-25 14:28:37 UTC
Hi,

I replaced the old options.py for the new one. Removed all compiled sources (*.pyc and *.pyo). Did run:
"python /usr/lib64/python2.6/compileall.py ." and
"python -O system-config-printer-kde.pyc"

Something is still not well, or do I something wrong?

Now starting systemsettings -> Printer Configuration gives:

[martin@ps-1866 ~]$ systemsettings(7167)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule: Module not already loaded, loading module  "Printer Configuration"  from library  "kpythonpluginfactory"  using symbol  "kpythonpluginfactory"
systemsettings(7167)/python (plugin) KPythonPluginFactory::KPythonPluginFactory: KPythonPluginFactory::KPythonPluginFactory()
systemsettings(7167)/python (plugin) KPythonPluginFactory::initialize: Initializing Python interpreter.
systemsettings(7167)/python (plugin) KPythonPluginFactory::initialize: Succesfully initialized Python interpreter.
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  KCModule
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  "system-config-printer-kde/system-config-printer-kde.py"
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py"
Traceback (most recent call last):
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 423, in on_tvMainList_cursor_changed
    self.fillPrinterTab(name)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 1146, in fillPrinterTab
    option.reinit (value, supported=supported)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 136, in reinit
    self.widget.addItem(self.combobox_dict[each])
AttributeError: OptionAlwaysShown instance has no attribute 'combobox_dict'
systemsettings(7167)/python (plugin): Error while running factory function for Python plugin:  "system-config-printer-kde/system-config-printer-kde.py"
Traceback (most recent call last):
  File "<string>", line 18, in kpythonpluginfactory_bridge
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4003, in CreatePlugin
    kcm = u.makeui(component_data, widget_parent)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 359, in makeui
    self.populateList(start_printer, change_ppd)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 635, in populateList
    self.on_tvMainList_cursor_changed()
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 423, in on_tvMainList_cursor_changed
    self.fillPrinterTab(name)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 1146, in fillPrinterTab
    option.reinit (value, supported=supported)
  File "/usr/share/kde4/apps/system-config-printer-kde/options.py", line 136, in reinit
    self.widget.addItem(self.combobox_dict[each])
AttributeError: OptionAlwaysShown instance has no attribute 'combobox_dict'
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  KCModule
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  ""
systemsettings(7167)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/home/martin/.kde/share/apps/"
systemsettings(7167)/python (plugin): Failed to import module
systemsettings(7167)/kcontrol KCModuleLoader::loadModule: This module has no valid entry symbol at all. The reason could be that it's still using K_EXPORT_COMPONENT_FACTORY with a custom X-KDE-FactoryName which is not supported anymore
systemsettings(7167)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
systemsettings(7167)/python (plugin) KPythonPluginFactory::~KPythonPluginFactory: KPythonPluginFactory::~KPythonPluginFactory()
Comment 10 Martin Kho 2010-01-31 10:04:42 UTC
Hi,

Issue in comment #9 was introduced in r1009674 (copy & paste issue? :-)). I've created a patch to correct the AttributeError.

I hope the patch is correct.

Martin Kho
Comment 11 Martin Kho 2010-01-31 10:06:24 UTC
Created attachment 40406 [details]
[Proposed patch] combobox_dict issue
Comment 12 Kevin Kofler 2010-02-10 23:42:16 UTC
Offending revision: http://websvn.kde.org/?view=rev&revision=1009674
The fix looks correct to me, can it please be applied? We'll also want to backport it to the Fedora packages.
Comment 13 jajaX 2010-02-11 22:23:05 UTC
Hi !

it's ok for me under kubuntu 9.10 with kde sc 4.4.

thanks you ;)
Comment 14 Luca Beltrame 2010-03-06 09:34:13 UTC
SVN commit 1099872 by lbeltrame:

Fix reinit() by removing the reference to combobox_dict. I had already changed a bit but that one slipped through...

CCBUG: 219751


 M  +4 -4      options.py  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1099872