[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeutils/printer-applet
From:       Jonathan Riddell <jr () jriddell ! org>
Date:       2009-01-19 17:41:15
Message-ID: 1232386875.026064.5278.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 913663 by jriddell:

Get rid of SYSTEM_CONFIG_PRINTER_DIR variable, can now just load ppds.py as a normal \
module.  Update README file. Fixes https://bugs.launchpad.net/318866 

 M  +8 -7      README  
 M  +6 -10     printer-applet.py  


--- trunk/KDE/kdeutils/printer-applet/README #913662:913663
@@ -5,7 +5,7 @@
 
 It replaces kjobviewer in KDE 3.
 
-It is a KDE port of system-config-printer by Tim Waugh from Red Hat.
+It is a KDE port of system-config-printer's applet.py by Tim Waugh from Red Hat.
 
 Dependencies are...
 
@@ -17,15 +17,16 @@
 
 hal-cups-utils:  svn co http://svn.fedorahosted.org/svn/hal-cups-utils/trunk/
 
-hal-cups-utils needs the common parts of system-config-printer (cupshelpers.py, \
ppds.py, probe_printer.py): +hal-cups-utils needs the common parts of \
system-config-printer (cupshelpers/*, ppds.py, probe_printer.py):  svn co \
http://svn.fedorahosted.org/svn/system-config-printer/trunk  
-hal-cups-utils and system-config-printer like to install to
-/usr/share/system-config-printer, if you put it elsewhere change the
-SYSTEM_CONFIG_PRINTER_DIR variable in printer-applet.py
+Note to packagers: system-config-printer is a Gnome app, please split
+out the parts needed by printer-applet (and kdeadmin's
+system-config-printer-kde) into a separate packages to stop KDE
+needing Gnome dependencies.  See for example these Ubuntu packages:
 
+http://packages.ubuntu.com/intrepid/all/python-cupshelpers/filelist
+http://packages.ubuntu.com/intrepid/all/system-config-printer-common/filelist
 
-Unfortunately it does not currently use PyKDE4 because KApplication loads QtDbus \
which freezes when we use python-dbus.  
-
 Jonathan Riddell <jriddell@ubuntu.com>, Canonical Ltd, March 2008
--- trunk/KDE/kdeutils/printer-applet/printer-applet.py #913662:913663
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
 
 #############################################################################
 ##
@@ -36,8 +37,6 @@
 import subprocess
 import sys
 
-SYSTEM_CONFIG_PRINTER_DIR = "/usr/share/system-config-printer"
-
 MIN_REFRESH_INTERVAL = 1 # seconds
 CONNECTING_TIMEOUT = 60 # seconds
 
@@ -49,11 +48,6 @@
 from PyKDE4.kdecore import i18n, i18nc, i18np, i18ncp, ki18n, KAboutData, \
KCmdLineArgs, KCmdLineOptions, KStandardDirs, KLocalizedString  from PyKDE4.kdeui \
import KApplication, KXmlGuiWindow, KStandardAction, KIcon, KToggleAction  
-if QFile.exists(SYSTEM_CONFIG_PRINTER_DIR + "/ppds.py"):
-    AUTOCONFIGURE = True
-else:
-    AUTOCONFIGURE = False
-
 def translate(self, prop):
     """reimplement method from uic to change it to use gettext"""
     if prop.get("notr", None) == "true":
@@ -301,8 +295,11 @@
             print >> sys.stderr, "%s: printer-applet failed to connect to system \
D-Bus"  sys.exit (1)
 
-        if AUTOCONFIGURE:
+        try:
+            import cupshelpers.ppds
             notification = NewPrinterNotification(bus, self)
+        except ImportError:
+            pass  # cupshelpers not installed, no new printer notification will be \
shown  
         # D-Bus
         bus.add_signal_receiver (self.handle_dbus_signal,
@@ -901,8 +898,7 @@
             return
         del c
 
-        sys.path.append (SYSTEM_CONFIG_PRINTER_DIR)
-        from ppds import ppdMakeModelSplit
+        from cupshelpers.ppds import ppdMakeModelSplit
         (make, model) = ppdMakeModelSplit (printer['printer-make-and-model'])
         driver = make + " " + model
         if status < self.STATUS_GENERIC_DRIVER:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic