tag 445281 patch pending
thanks

Hi,

attached is the NMU diff.
Note that your package needs some work. For example, dropping cdbs would be a good idea if you have to jump through that many hoops. Or getting the setup.py to do work for you. I have only included changes needed to rectify the two issues, some more should be fixed by the maintainers.

Kind regards

T.
--
Thomas Viehmann, http://thomas.viehmann.net/
diff -u kde-guidance-0.8.0/debian/changelog kde-guidance-0.8.0/debian/changelog
--- kde-guidance-0.8.0/debian/changelog
+++ kde-guidance-0.8.0/debian/changelog
@@ -1,3 +1,12 @@
+kde-guidance (0.8.0-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix double build FTBFS. They annoy NMUers. Closes: #424430
+  * Move python modules into private dirs. Closes: #445281
+    + This requires fixing and expanding the interpreter adjustment.
+
+ -- Thomas Viehmann <[EMAIL PROTECTED]>  Fri, 07 Mar 2008 22:06:05 +0100
+
 kde-guidance (0.8.0-2) unstable; urgency=low
 
   * Add Build-Depends: python-qt-dev
diff -u kde-guidance-0.8.0/debian/control kde-guidance-0.8.0/debian/control
--- kde-guidance-0.8.0/debian/control
+++ kde-guidance-0.8.0/debian/control
@@ -6,9 +6,10 @@
 Build-Depends: cdbs, debhelper (>= 5), chrpath, kdelibs4-dev,
  libpythonize0-dev, libtool, libxml2-utils, libxss-dev, libxxf86vm-dev,
  pykdeextensions, pyqt-tools, python-kde3, python-kde3-dev, python-sip4-dev,
- python-support (>= 0.6), python-all-dev (>= 2.3.5-11), x11proto-scrnsaver-dev,
+ python-support (>= 0.6), python-dev (>= 2.3.5-11), x11proto-scrnsaver-dev,
  python-qt-dev
 Standards-Version: 3.7.2
+XS-Python-Version: current
 
 Package: kde-guidance
 Architecture: any
diff -u kde-guidance-0.8.0/debian/rules kde-guidance-0.8.0/debian/rules
--- kde-guidance-0.8.0/debian/rules
+++ kde-guidance-0.8.0/debian/rules
@@ -9,7 +9,8 @@
 
 DEB_DH_INSTALL_ARGS = --sourcedir=debian/tmp
 DEB_INSTALL_MANPAGES_kde-guidance := debian/displayconfig.1  debian/mountconfig.1  debian/serviceconfig.1  debian/userconfig.1
-PYSUPPORT_PATH = $(DEB_DESTDIR)/usr/share/python-support/kde-guidance
+PYSUPPORT_PATH = $(DEB_DESTDIR)/usr/share/guidance/python
+DEB_PYTHON_PRIVATE_MODULES_DIRS = /usr/share/guidance/python /usr/lib/guidance/python
 
 install/kde-guidance::
 	# install icons to right place
@@ -34,9 +35,9 @@
 	install -D -p -m0755 displayconfig/displayconfig-hwprobe.py \
 		$(PYSUPPORT_PATH)/displayconfig-hwprobe.py
 
-	# move python modules in PYSUPPORT_PATH
-	mv $(DEB_DESTDIR)/usr/lib/python*/site-packages/*.py $(PYSUPPORT_PATH)
-	mv $(DEB_DESTDIR)/usr/share/apps/guidance/*.py $(PYSUPPORT_PATH)
+	# copy python modules in PYSUPPORT_PATH
+	cp $(DEB_DESTDIR)/usr/lib/python*/site-packages/*.py $(PYSUPPORT_PATH)
+	cp $(DEB_DESTDIR)/usr/share/apps/guidance/*.py $(PYSUPPORT_PATH)
 
         # fix script-not-executable
 	chmod 0755 $(PYSUPPORT_PATH)/xf86misc.py
@@ -58,18 +59,19 @@
 
 	# fix the link properly
 	mkdir -p debian/kde-guidance/usr/bin
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/displayconfig.py displayconfig)
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/displayconfig-restore.py displayconfig-restore)
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/mountconfig.py mountconfig)
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/serviceconfig.py serviceconfig)
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/userconfig.py userconfig)
-	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/wineconfig.py wineconfig)
-#	(cd debian/kde-guidance/usr/bin; ln -sf ../share/python-support/kde-guidance/grubconfig.py grubconfig)
-
-	: # Replace all '#!' calls to python with /usr/bin/python
-	: # and make them executable
-	for i in `find debian/kde-guidance -type f`; do \
-		sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/displayconfig.py displayconfig)
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/displayconfig-restore.py displayconfig-restore)
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/mountconfig.py mountconfig)
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/serviceconfig.py serviceconfig)
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/userconfig.py userconfig)
+	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/wineconfig.py wineconfig)
+#	(cd debian/kde-guidance/usr/bin; ln -sf ../share/guidance/python/grubconfig.py grubconfig)
+
+	# Replace all '#!' calls to python with /usr/bin/python
+	# and make them executable and add sys.path
+	# some care must be taken to not process twice
+	for i in $$(find debian/tmp -type f | xargs grep -L 'import sys ; sys.path\[:0\] = \["/usr/share/guidance/python/","/usr/lib/guidance/python/"\]' ); do \
+		sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1\n# -*- coding: UTF-8 -*-\nimport sys ; sys.path[:0] = ["/usr/share/guidance/python/"\,"/usr/lib/guidance/python/"],' \
 			$$i > $$i.temp; \
 		if cmp --quiet $$i $$i.temp; then \
 			rm -f $$i.temp; \
@@ -96,21 +98,22 @@
 	(cd powermanager; kdepyuic tooltip.ui)
 	(cd powermanager; kdepyuic notify.ui)
 
-	# move python modules in PYSUPPORT_PATH
-	mv powermanager/*.py $(PYSUPPORT_PATH)
+	# copy python modules in PYSUPPORT_PATH
+	cp powermanager/*.py $(PYSUPPORT_PATH)
 
 	# generate guidance-power-manager script
 	echo "#!/bin/sh" > $(DEB_DESTDIR)/usr/bin/guidance-power-manager
-	echo "/usr/share/python-support/kde-guidance/guidance-power-manager.py &" >> $(DEB_DESTDIR)/usr/bin/guidance-power-manager
+	echo "/usr/share/guidance/python/guidance-power-manager.py &" >> $(DEB_DESTDIR)/usr/bin/guidance-power-manager
 	chmod +x $(DEB_DESTDIR)/usr/bin/guidance-power-manager
 
 	# fix script-not-executable
 	chmod 0755 $(PYSUPPORT_PATH)/powermanage.py
 
-	: # Replace all '#!' calls to python with /usr/bin/python
-	: # and make them executable
-	for i in `find debian/kde-guidance-powermanager -type f`; do \
-		sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
+	# Replace all '#!' calls to python with /usr/bin/python
+	# and make them executable and add sys.path
+	# some care must be taken to not process twice
+	for i in $$(find debian/tmp -type f | xargs grep -L 'import sys ; sys.path\[:0\] = \["/usr/share/guidance/python/","/usr/lib/guidance/python/"\]' ); do \
+		sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1\n# -*- coding: UTF-8 -*-\nimport sys ; sys.path[:0] = ["/usr/share/guidance/python/"\,"/usr/lib/guidance/python/"],' \
 			$$i > $$i.temp; \
 		if cmp --quiet $$i $$i.temp; then \
 			rm -f $$i.temp; \
diff -u kde-guidance-0.8.0/debian/kde-guidance.install kde-guidance-0.8.0/debian/kde-guidance.install
--- kde-guidance-0.8.0/debian/kde-guidance.install
+++ kde-guidance-0.8.0/debian/kde-guidance.install
@@ -13,7 +13,7 @@
 usr/lib/kde3/kcm_wineconfig.so.0.0.0
 usr/lib/kde3/kcm_wineconfig.la
 usr/lib/kde3/kcm_wineconfig.a
-usr/lib/python*/site-packages/ixf86misc.so
+usr/lib/python*/site-packages/ixf86misc.so usr/lib/guidance/python/
 usr/share/icons/crystalsvg/16x16/apps/daemons.png
 usr/share/icons/crystalsvg/16x16/apps/disksfilesystems.png
 usr/share/icons/crystalsvg/16x16/apps/userconfig.png
@@ -108,37 +108,37 @@
 usr/share/apps/guidance/Cards+
 usr/share/apps/guidance/MonitorsDB
 usr/share/apps/guidance/pcitable
-usr/share/python-support/kde-guidance/displayconfig-hwprobe.py
-usr/share/python-support/kde-guidance/xf86misc.py
-usr/share/python-support/kde-guidance/MicroHAL.py
-usr/share/python-support/kde-guidance/SMBShareSelectDialog.py
-usr/share/python-support/kde-guidance/ScanPCI.py
-usr/share/python-support/kde-guidance/displayconfig-hwprobe.py
-usr/share/python-support/kde-guidance/xf86misc.py
-usr/share/python-support/kde-guidance/MicroHAL.py
-usr/share/python-support/kde-guidance/SMBShareSelectDialog.py
-usr/share/python-support/kde-guidance/ScanPCI.py
-usr/share/python-support/kde-guidance/SimpleCommandRunner.py
-usr/share/python-support/kde-guidance/displayconfig-restore.py
-usr/share/python-support/kde-guidance/displayconfig.py
-usr/share/python-support/kde-guidance/displayconfigabstraction.py
-usr/share/python-support/kde-guidance/displayconfigwidgets.py
-usr/share/python-support/kde-guidance/drivedetect.py
-usr/share/python-support/kde-guidance/execwithcapture.py
-usr/share/python-support/kde-guidance/fuser.py
-usr/share/python-support/kde-guidance/fuser_ui.py
-#usr/share/python-support/kde-guidance/grubconfig.py
-usr/share/python-support/kde-guidance/ktimerdialog.py
-usr/share/python-support/kde-guidance/mountconfig.py
-usr/share/python-support/kde-guidance/servertestdialog.py
-usr/share/python-support/kde-guidance/serviceconfig.py
-usr/share/python-support/kde-guidance/sizeview.py
-usr/share/python-support/kde-guidance/unixauthdb.py
-usr/share/python-support/kde-guidance/userconfig.py
-usr/share/python-support/kde-guidance/wineconfig.py
-usr/share/python-support/kde-guidance/wineread.py
-usr/share/python-support/kde-guidance/winewrite.py
-usr/share/python-support/kde-guidance/xorgconfig.py
+usr/share/guidance/python/displayconfig-hwprobe.py
+usr/share/guidance/python/xf86misc.py
+usr/share/guidance/python/MicroHAL.py
+usr/share/guidance/python/SMBShareSelectDialog.py
+usr/share/guidance/python/ScanPCI.py
+usr/share/guidance/python/displayconfig-hwprobe.py
+usr/share/guidance/python/xf86misc.py
+usr/share/guidance/python/MicroHAL.py
+usr/share/guidance/python/SMBShareSelectDialog.py
+usr/share/guidance/python/ScanPCI.py
+usr/share/guidance/python/SimpleCommandRunner.py
+usr/share/guidance/python/displayconfig-restore.py
+usr/share/guidance/python/displayconfig.py
+usr/share/guidance/python/displayconfigabstraction.py
+usr/share/guidance/python/displayconfigwidgets.py
+usr/share/guidance/python/drivedetect.py
+usr/share/guidance/python/execwithcapture.py
+usr/share/guidance/python/fuser.py
+usr/share/guidance/python/fuser_ui.py
+#usr/share/guidance/python/grubconfig.py
+usr/share/guidance/python/ktimerdialog.py
+usr/share/guidance/python/mountconfig.py
+usr/share/guidance/python/servertestdialog.py
+usr/share/guidance/python/serviceconfig.py
+usr/share/guidance/python/sizeview.py
+usr/share/guidance/python/unixauthdb.py
+usr/share/guidance/python/userconfig.py
+usr/share/guidance/python/wineconfig.py
+usr/share/guidance/python/wineread.py
+usr/share/guidance/python/winewrite.py
+usr/share/guidance/python/xorgconfig.py
 etc/X11/Xsession.d/40guidance-displayconfig_restore
 usr/lib/kde3/kcm_serviceconfig.so.0
 usr/lib/kde3/kcm_serviceconfig.so
diff -u kde-guidance-0.8.0/debian/kde-guidance-powermanager.install kde-guidance-0.8.0/debian/kde-guidance-powermanager.install
--- kde-guidance-0.8.0/debian/kde-guidance-powermanager.install
+++ kde-guidance-0.8.0/debian/kde-guidance-powermanager.install
@@ -7,7 +7,7 @@
-usr/share/python-support/kde-guidance/guidance-power-manager.py
-usr/share/python-support/kde-guidance/guidance_power_manager_ui.py
-usr/share/python-support/kde-guidance/notify.py
-usr/share/python-support/kde-guidance/powermanage.py
-usr/share/python-support/kde-guidance/powermanager_ui.py
-usr/share/python-support/kde-guidance/tooltip.py
-usr/share/python-support/kde-guidance/hal-test.py
+usr/share/guidance/python/guidance-power-manager.py
+usr/share/guidance/python/guidance_power_manager_ui.py
+usr/share/guidance/python/notify.py
+usr/share/guidance/python/powermanage.py
+usr/share/guidance/python/powermanager_ui.py
+usr/share/guidance/python/tooltip.py
+usr/share/guidance/python/hal-test.py
diff -u kde-guidance-0.8.0/debian/kde-guidance.init kde-guidance-0.8.0/debian/kde-guidance.init
--- kde-guidance-0.8.0/debian/kde-guidance.init
+++ kde-guidance-0.8.0/debian/kde-guidance.init
@@ -20,7 +20,7 @@
 
 case "$1" in
   start)
-	/usr/share/python-support/kde-guidance/displayconfig-hwprobe.py
+	/usr/share/guidance/python/displayconfig-hwprobe.py
 	;;
   stop)
 	;;
reverted:
--- kde-guidance-0.8.0/debian/pyversions
+++ kde-guidance-0.8.0.orig/debian/pyversions
@@ -1 +0,0 @@
-2.4
only in patch2:
unchanged:
--- kde-guidance-0.8.0.orig/debian/x.sh
+++ kde-guidance-0.8.0/debian/x.sh
@@ -0,0 +1,11 @@
+	for i in `find debian/kde-guidance -type f`; do \
+		sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1\n# -*- coding: UTF-8 -*-\nimport sys ; sys.path[:0] = ["/usr/share/guidance/python/"\,"/usr/lib/guidance/python/"],' \
+			$i > $i.temp; \
+		if cmp --quiet $i $i.temp; then \
+			rm -f $i.temp; \
+		else \
+			mv -f $i.temp $i; \
+			chmod 755 $i; \
+			echo "fixed interpreter: $i"; \
+		fi; \
+	done
only in patch2:
unchanged:
--- kde-guidance-0.8.0.orig/wineconfig/kcm_wineconfig.cpp
+++ kde-guidance-0.8.0/wineconfig/kcm_wineconfig.cpp
@@ -0,0 +1,141 @@
+
+/*
+ * pykcm_launcher.cpp
+ * 
+ * Launch Control Centre modules written in Python using an embedded Python
+ * interpreter.
+ * Based on David Boddie's PyKDE-components.
+ */
+
+// pythonize.h must be included first.
+#include <pythonize.h>
+#include <kcmodule.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <klibloader.h>
+#include <kstandarddirs.h>
+#include <ksimpleconfig.h>
+#include <qstring.h>
+#include <sip.h>
+
+#define MODULE_DIR "/tmp/kde-guidance-0.8.0/debian/tmp/usr/share/apps/guidance"
+#define MODULE_NAME "wineconfig"
+#define FACTORY "create_wineconfig"
+#define CPP_FACTORY create_wineconfig
+#define LIB_PYTHON "libpython2.5.so"
+#define debug 1
+
+static KCModule *report_error(char *msg) {
+    if (debug) printf ("error: %s\n", msg);
+    return NULL;
+}
+
+static KCModule* return_instance( QWidget *parent, const char *name ) {
+    KCModule* kcmodule;
+    PyObject *pyKCModuleTuple; 
+    PyObject *pyKCModule;
+    Pythonize *pyize;  // Pythonize object to manage the Python interpreter.
+    int isErr;
+    
+    // Try to determine what py script we're loading. Note that "name"
+    // typically appears to be NULL.
+    QString script(MODULE_NAME);
+
+    // Reload libpython, but this time tell the runtime linker to make the
+    // symbols global and available for later loaded libraries/module.
+    KLibLoader::self()->globalLibrary(LIB_PYTHON);
+    
+    // Start the interpreter.
+    pyize = initialize();
+    if (!pyize) {
+        return report_error ("***Failed to start interpreter\n");
+    }
+    
+    // Add the path to the python script to the interpreter search path.
+    QString path = QString(MODULE_DIR);
+    if(path == QString::null) {
+        return report_error ("***Failed to locate script path");
+    }
+    if(!pyize->appendToSysPath (path.latin1 ())) {
+        return report_error ("***Failed to set sys.path\n");
+    }
+    
+    // Load the Python script.
+    PyObject *pyModule = pyize->importModule ((char *)script.latin1 ());
+    if(!pyModule) {
+        PyErr_Print();
+        return report_error ("***failed to import module\n");
+    }
+
+    // Inject a helper function
+    QString bridge = QString("import sip\n" 
+                            "import qt\n"
+                            "def kcontrol_bridge_" FACTORY "(parent,name):\n"
+                             "    if parent!=0:\n"
+#if SIP_VERSION >= 0x040200
+                             "        wparent = sip.wrapinstance(parent,qt.QWidget)\n"
+#else                             
+                             "        wparent = sip.wrapinstance(parent,'QWidget')\n"
+#endif
+                             "    else:\n"
+                             "        wparent = None\n"
+                             "    inst = " FACTORY "(wparent, name)\n"
+                             "    return (inst,sip.unwrapinstance(inst))\n");
+    PyRun_String(bridge.latin1(),Py_file_input,PyModule_GetDict(pyModule),PyModule_GetDict(pyModule));
+
+    // Get the Python module's factory function.
+    PyObject *kcmFactory = pyize->getNewObjectRef(pyModule, "kcontrol_bridge_" FACTORY);
+    if(!kcmFactory) {
+        return report_error ("***failed to find module factory\n");
+    }
+    
+    // Call the factory function. Set up the args.
+    PyObject *pyParent = PyLong_FromVoidPtr(parent);
+    PyObject *pyName = PyString_FromString(MODULE_NAME);
+        // Using NN here is effect gives our references to the arguement away.
+    PyObject *args = Py_BuildValue ("NN", pyParent, pyName);
+    if(pyName && pyParent && args) {
+        // run the factory function
+        pyKCModuleTuple = pyize->runFunction(kcmFactory, args);
+        if(!pyKCModuleTuple) {
+            PyErr_Print();
+            return report_error ("*** runFunction failure\n;");
+        }
+    } else {
+        return report_error ("***failed to create args\n");
+    }
+    // cleanup a bit
+    pyize->decref(args);
+    pyize->decref(kcmFactory);
+
+    // Stop this from getting garbage collected.
+    Py_INCREF(PyTuple_GET_ITEM(pyKCModuleTuple,0));
+    
+    // convert the KCModule PyObject to a real C++ KCModule *.
+    isErr = 0;
+    pyKCModule = PyTuple_GET_ITEM(pyKCModuleTuple,1);
+    kcmodule = (KCModule *)PyLong_AsVoidPtr(pyKCModule);
+    if(!kcmodule) {
+        return report_error ("***failed sip conversion to C++ pointer\n");
+    }
+    pyize->decref(pyKCModuleTuple);
+    
+    // PyKDE can't run the module without this - Pythonize
+    // grabs the lock at initialization and we have to give
+    // it back before exiting. At this point, we no longer need
+    // it.
+    //pyize->releaseLock ();
+
+    // take care of any translation info
+    KGlobal::locale()->insertCatalogue(script);
+
+    // Return the pointer to our new KCModule
+    return kcmodule;
+}
+
+extern "C" {
+    // Factory function that kcontrol will call.
+    KCModule* CPP_FACTORY(QWidget *parent, const char *name) {
+        return return_instance(parent, name);
+    }
+}
only in patch2:
unchanged:
--- kde-guidance-0.8.0.orig/powermanager/tooltip.py
+++ kde-guidance-0.8.0/powermanager/tooltip.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'tooltip.ui'
+#
+# Created: Sat Mar 8 00:53:20 2008
+#      by: The PyQt User Interface Compiler (pyuic) 3.17.4
+#
+# WARNING! All changes made in this file will be lost!
+
+
+import sys
+from qt import *
+from kdecore import KCmdLineArgs, KApplication
+from kdeui import *
+
+from kdeui import *
+
+class ToolTip(QWidget):
+    def __init__(self,parent = None,name = None,fl = 0):
+        QWidget.__init__(self,parent,name,fl)
+
+        if not name:
+            self.setName("ToolTip")
+
+        self.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding,QSizePolicy.MinimumExpanding,0,0,self.sizePolicy().hasHeightForWidth()))
+        self.setMinimumSize(QSize(240,0))
+        self.setBaseSize(QSize(200,0))
+
+        ToolTipLayout = QVBoxLayout(self,0,6,"ToolTipLayout")
+
+        self.languageChange()
+
+        self.resize(QSize(300,80).expandedTo(self.minimumSizeHint()))
+        self.clearWState(Qt.WState_Polished)
+
+
+    def languageChange(self):
+        self.setCaption(self.__tr("Form1"))
+
+
+    def ToolTip_destroyed(self,a0):
+        print "ToolTip.ToolTip_destroyed(QObject*): Not implemented yet"
+
+    def __tr(self,s,c = None):
+        return qApp.translate("ToolTip",s,c)
+
+if __name__ == "__main__":
+    appname     = ""
+    description = ""
+    version     = ""
+
+    KCmdLineArgs.init (sys.argv, appname, description, version)
+    a = KApplication ()
+
+    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
+    w = ToolTip()
+    a.setMainWidget(w)
+    w.show()
+    a.exec_loop()
only in patch2:
unchanged:
--- kde-guidance-0.8.0.orig/powermanager/notify.py
+++ kde-guidance-0.8.0/powermanager/notify.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'notify.ui'
+#
+# Created: Sat Mar 8 00:53:20 2008
+#      by: The PyQt User Interface Compiler (pyuic) 3.17.4
+#
+# WARNING! All changes made in this file will be lost!
+
+
+import sys
+from qt import *
+from kdecore import KCmdLineArgs, KApplication
+from kdeui import *
+
+
+class NotifyWidget(QWidget):
+    def __init__(self,parent = None,name = None,fl = 0):
+        QWidget.__init__(self,parent,name,fl)
+
+        if not name:
+            self.setName("NotifyWidgetUI")
+
+        self.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding,QSizePolicy.MinimumExpanding,0,0,self.sizePolicy().hasHeightForWidth()))
+        self.setBaseSize(QSize(0,0))
+
+        NotifyWidgetUILayout = QGridLayout(self,1,1,11,6,"NotifyWidgetUILayout")
+
+        self.Icon = QLabel(self,"Icon")
+        self.Icon.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.Icon.sizePolicy().hasHeightForWidth()))
+        self.Icon.setScaledContents(1)
+
+        NotifyWidgetUILayout.addMultiCellWidget(self.Icon,0,1,0,0)
+
+        self.Text = QLabel(self,"Text")
+
+        NotifyWidgetUILayout.addWidget(self.Text,1,1)
+
+        self.Caption = QLabel(self,"Caption")
+
+        NotifyWidgetUILayout.addWidget(self.Caption,0,1)
+
+        self.languageChange()
+
+        self.resize(QSize(151,60).expandedTo(self.minimumSizeHint()))
+        self.clearWState(Qt.WState_Polished)
+
+
+    def languageChange(self):
+        self.setCaption(self.__tr("Form3"))
+        self.Text.setText(QString.null)
+        self.Caption.setText(self.__tr("<b>Powermanager:</b>"))
+
+
+    def __tr(self,s,c = None):
+        return qApp.translate("NotifyWidget",s,c)
+
+if __name__ == "__main__":
+    appname     = ""
+    description = ""
+    version     = ""
+
+    KCmdLineArgs.init (sys.argv, appname, description, version)
+    a = KApplication ()
+
+    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
+    w = NotifyWidget()
+    a.setMainWidget(w)
+    w.show()
+    a.exec_loop()
only in patch2:
unchanged:
--- kde-guidance-0.8.0.orig/powermanager/guidance_power_manager_ui.py
+++ kde-guidance-0.8.0/powermanager/guidance_power_manager_ui.py
@@ -0,0 +1,243 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'guidance_power_manager_ui.ui'
+#
+# Created: Sat Mar 8 00:53:20 2008
+#      by: The PyQt User Interface Compiler (pyuic) 3.17.4
+#
+# WARNING! All changes made in this file will be lost!
+
+
+import sys
+from qt import *
+from kdecore import KCmdLineArgs, KApplication
+from kdeui import *
+
+
+
+class PowerManagerUI(QWidget):
+    def __init__(self,parent = None,name = None,fl = 0):
+        QWidget.__init__(self,parent,name,fl)
+
+        if not name:
+            self.setName("PowerManagerUI")
+
+        self.setMouseTracking(1)
+
+        PowerManagerUILayout = QVBoxLayout(self,11,6,"PowerManagerUILayout")
+
+        self.GeneralSettingsBox = QGroupBox(self,"GeneralSettingsBox")
+        self.GeneralSettingsBox.setColumnLayout(0,Qt.Vertical)
+        self.GeneralSettingsBox.layout().setSpacing(6)
+        self.GeneralSettingsBox.layout().setMargin(11)
+        GeneralSettingsBoxLayout = QVBoxLayout(self.GeneralSettingsBox.layout())
+        GeneralSettingsBoxLayout.setAlignment(Qt.AlignTop)
+
+        self.lockScreenOnResume = QCheckBox(self.GeneralSettingsBox,"lockScreenOnResume")
+        GeneralSettingsBoxLayout.addWidget(self.lockScreenOnResume)
+        PowerManagerUILayout.addWidget(self.GeneralSettingsBox)
+
+        self.MainsPoweredBox = QGroupBox(self,"MainsPoweredBox")
+        self.MainsPoweredBox.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.MainsPoweredBox.sizePolicy().hasHeightForWidth()))
+        self.MainsPoweredBox.setColumnLayout(0,Qt.Vertical)
+        self.MainsPoweredBox.layout().setSpacing(6)
+        self.MainsPoweredBox.layout().setMargin(11)
+        MainsPoweredBoxLayout = QVBoxLayout(self.MainsPoweredBox.layout())
+        MainsPoweredBoxLayout.setAlignment(Qt.AlignTop)
+
+        layout17 = QHBoxLayout(None,0,6,"layout17")
+
+        self.PoweredBrightnessLabel = QLabel(self.MainsPoweredBox,"PoweredBrightnessLabel")
+        layout17.addWidget(self.PoweredBrightnessLabel)
+
+        self.PoweredBrightnessSlider = QSlider(self.MainsPoweredBox,"PoweredBrightnessSlider")
+        self.PoweredBrightnessSlider.setMouseTracking(1)
+        self.PoweredBrightnessSlider.setAcceptDrops(1)
+        self.PoweredBrightnessSlider.setMaxValue(7)
+        self.PoweredBrightnessSlider.setLineStep(1)
+        self.PoweredBrightnessSlider.setPageStep(1)
+        self.PoweredBrightnessSlider.setOrientation(QSlider.Horizontal)
+        self.PoweredBrightnessSlider.setTickmarks(QSlider.Both)
+        self.PoweredBrightnessSlider.setTickInterval(0)
+        layout17.addWidget(self.PoweredBrightnessSlider)
+        MainsPoweredBoxLayout.addLayout(layout17)
+
+        layout13 = QHBoxLayout(None,0,6,"layout13")
+        spacer12_3_2_2 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        layout13.addItem(spacer12_3_2_2)
+
+        self.PoweredIdleLabel = QLabel(self.MainsPoweredBox,"PoweredIdleLabel")
+        layout13.addWidget(self.PoweredIdleLabel)
+
+        self.PoweredIdleTime = QSpinBox(self.MainsPoweredBox,"PoweredIdleTime")
+        layout13.addWidget(self.PoweredIdleTime)
+
+        self.PoweredIdleCombo = QComboBox(0,self.MainsPoweredBox,"PoweredIdleCombo")
+        layout13.addWidget(self.PoweredIdleCombo)
+        MainsPoweredBoxLayout.addLayout(layout13)
+
+        layout13_2_2 = QHBoxLayout(None,0,6,"layout13_2_2")
+        spacer12_3_2_2_3_2 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        layout13_2_2.addItem(spacer12_3_2_2_3_2)
+
+        self.PoweredFreqLabel = QLabel(self.MainsPoweredBox,"PoweredFreqLabel")
+        layout13_2_2.addWidget(self.PoweredFreqLabel)
+
+        self.PoweredFreqCombo = QComboBox(0,self.MainsPoweredBox,"PoweredFreqCombo")
+        layout13_2_2.addWidget(self.PoweredFreqCombo)
+        MainsPoweredBoxLayout.addLayout(layout13_2_2)
+        PowerManagerUILayout.addWidget(self.MainsPoweredBox)
+
+        self.BatteryBox = QGroupBox(self,"BatteryBox")
+        self.BatteryBox.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.BatteryBox.sizePolicy().hasHeightForWidth()))
+        self.BatteryBox.setColumnLayout(0,Qt.Vertical)
+        self.BatteryBox.layout().setSpacing(6)
+        self.BatteryBox.layout().setMargin(11)
+        BatteryBoxLayout = QVBoxLayout(self.BatteryBox.layout())
+        BatteryBoxLayout.setAlignment(Qt.AlignTop)
+
+        layout16 = QHBoxLayout(None,0,6,"layout16")
+
+        self.BatteryBrightnessLabel = QLabel(self.BatteryBox,"BatteryBrightnessLabel")
+        layout16.addWidget(self.BatteryBrightnessLabel)
+
+        self.BatteryBrightnessSlider = QSlider(self.BatteryBox,"BatteryBrightnessSlider")
+        self.BatteryBrightnessSlider.setMouseTracking(1)
+        self.BatteryBrightnessSlider.setMaxValue(7)
+        self.BatteryBrightnessSlider.setPageStep(1)
+        self.BatteryBrightnessSlider.setOrientation(QSlider.Horizontal)
+        self.BatteryBrightnessSlider.setTickmarks(QSlider.Both)
+        layout16.addWidget(self.BatteryBrightnessSlider)
+        BatteryBoxLayout.addLayout(layout16)
+
+        layout14 = QGridLayout(None,1,1,0,6,"layout14")
+
+        self.BatteryIdleCombo = QComboBox(0,self.BatteryBox,"BatteryIdleCombo")
+
+        layout14.addWidget(self.BatteryIdleCombo,1,4)
+
+        self.BatteryIdleLabel = QLabel(self.BatteryBox,"BatteryIdleLabel")
+
+        layout14.addWidget(self.BatteryIdleLabel,1,2)
+
+        self.BatteryCriticalCombo = QComboBox(0,self.BatteryBox,"BatteryCriticalCombo")
+
+        layout14.addWidget(self.BatteryCriticalCombo,0,4)
+
+        self.BatteryCriticalLabel = QLabel(self.BatteryBox,"BatteryCriticalLabel")
+
+        layout14.addMultiCellWidget(self.BatteryCriticalLabel,0,0,1,2)
+
+        self.BatteryIdleTime = QSpinBox(self.BatteryBox,"BatteryIdleTime")
+
+        layout14.addWidget(self.BatteryIdleTime,1,3)
+
+        self.CriticalRemainTime = QSpinBox(self.BatteryBox,"CriticalRemainTime")
+
+        layout14.addWidget(self.CriticalRemainTime,0,3)
+        spacer12_3 = QSpacerItem(28,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        layout14.addItem(spacer12_3,0,0)
+        spacer12_3_2 = QSpacerItem(50,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        layout14.addMultiCell(spacer12_3_2,1,1,0,1)
+        BatteryBoxLayout.addLayout(layout14)
+
+        layout13_2 = QHBoxLayout(None,0,6,"layout13_2")
+        spacer12_3_2_2_3 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        layout13_2.addItem(spacer12_3_2_2_3)
+
+        self.BatteryFreqLabel = QLabel(self.BatteryBox,"BatteryFreqLabel")
+        layout13_2.addWidget(self.BatteryFreqLabel)
+
+        self.BatteryFreqCombo = QComboBox(0,self.BatteryBox,"BatteryFreqCombo")
+        layout13_2.addWidget(self.BatteryFreqCombo)
+        BatteryBoxLayout.addLayout(layout13_2)
+        PowerManagerUILayout.addWidget(self.BatteryBox)
+
+        self.LaptopLidRadios = QButtonGroup(self,"LaptopLidRadios")
+        self.LaptopLidRadios.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.LaptopLidRadios.sizePolicy().hasHeightForWidth()))
+        self.LaptopLidRadios.setFrameShape(QButtonGroup.GroupBoxPanel)
+        self.LaptopLidRadios.setColumnLayout(0,Qt.Vertical)
+        self.LaptopLidRadios.layout().setSpacing(5)
+        self.LaptopLidRadios.layout().setMargin(11)
+        LaptopLidRadiosLayout = QHBoxLayout(self.LaptopLidRadios.layout())
+        LaptopLidRadiosLayout.setAlignment(Qt.AlignTop)
+
+        self.laptopClosedNone = QRadioButton(self.LaptopLidRadios,"laptopClosedNone")
+        LaptopLidRadiosLayout.addWidget(self.laptopClosedNone)
+
+        self.laptopClosedBlank = QRadioButton(self.LaptopLidRadios,"laptopClosedBlank")
+        LaptopLidRadiosLayout.addWidget(self.laptopClosedBlank)
+
+        self.laptopClosedSuspend = QRadioButton(self.LaptopLidRadios,"laptopClosedSuspend")
+        LaptopLidRadiosLayout.addWidget(self.laptopClosedSuspend)
+
+        self.laptopClosedHibernate = QRadioButton(self.LaptopLidRadios,"laptopClosedHibernate")
+        LaptopLidRadiosLayout.addWidget(self.laptopClosedHibernate)
+
+        self.laptopClosedShutdown = QRadioButton(self.LaptopLidRadios,"laptopClosedShutdown")
+        LaptopLidRadiosLayout.addWidget(self.laptopClosedShutdown)
+        spacer12_2 = QSpacerItem(213,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
+        LaptopLidRadiosLayout.addItem(spacer12_2)
+        PowerManagerUILayout.addWidget(self.LaptopLidRadios)
+        spacer11 = QSpacerItem(31,80,QSizePolicy.Minimum,QSizePolicy.Expanding)
+        PowerManagerUILayout.addItem(spacer11)
+
+        self.languageChange()
+
+        self.resize(QSize(505,374).expandedTo(self.minimumSizeHint()))
+        self.clearWState(Qt.WState_Polished)
+
+
+    def languageChange(self):
+        self.setCaption(self.__tr("PowerManagerUI"))
+        self.GeneralSettingsBox.setTitle(self.__tr("General Settings"))
+        self.lockScreenOnResume.setText(self.__tr("Lock screen on resume"))
+        self.MainsPoweredBox.setTitle(self.__tr("Mains Powered"))
+        self.PoweredBrightnessLabel.setText(self.__tr("Brightness"))
+        QWhatsThis.add(self.PoweredBrightnessSlider,self.__tr("With this slider you can set the brightness when the system is plugged into the socket outlet"))
+        self.PoweredIdleLabel.setText(self.__tr("When the system is idle for more than"))
+        self.PoweredIdleTime.setPrefix(QString.null)
+        self.PoweredIdleTime.setSuffix(self.__tr(" min"))
+        QWhatsThis.add(self.PoweredIdleTime,self.__tr("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
+        self.PoweredFreqLabel.setText(self.__tr("CPU frequency scaling policy"))
+        self.BatteryBox.setTitle(self.__tr("Battery Powered"))
+        self.BatteryBrightnessLabel.setText(self.__tr("Brightness"))
+        QWhatsThis.add(self.BatteryBrightnessSlider,self.__tr("This slider controls the brightness when the system runs on batteries"))
+        self.BatteryIdleLabel.setText(self.__tr("When the system is idle for more than"))
+        self.BatteryCriticalLabel.setText(self.__tr("When battery remaining time drops below"))
+        self.BatteryIdleTime.setPrefix(QString.null)
+        self.BatteryIdleTime.setSuffix(self.__tr(" min"))
+        QWhatsThis.add(self.BatteryIdleTime,self.__tr("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
+        self.CriticalRemainTime.setPrefix(QString.null)
+        self.CriticalRemainTime.setSuffix(self.__tr(" min"))
+        QWhatsThis.add(self.CriticalRemainTime,self.__tr("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
+        self.BatteryFreqLabel.setText(self.__tr("CPU frequency scaling policy"))
+        self.LaptopLidRadios.setTitle(self.__tr("When Laptop Lid Closed"))
+        self.laptopClosedNone.setText(self.__tr("Do nothing"))
+        self.laptopClosedBlank.setText(self.__tr("Lock screen"))
+        self.laptopClosedSuspend.setText(self.__tr("Suspend"))
+        QToolTip.add(self.laptopClosedSuspend,self.__tr("Suspend to Memory"))
+        QWhatsThis.add(self.laptopClosedSuspend,self.__tr("Suspend is a sleep state, the system will consume only very little energy when suspended"))
+        self.laptopClosedHibernate.setText(self.__tr("Hibernate"))
+        QToolTip.add(self.laptopClosedHibernate,self.__tr("Suspend to Disk"))
+        QWhatsThis.add(self.laptopClosedHibernate,self.__tr("Hibernate or \"Suspend to Disk\" is a deep sleepstate, allowing the system to power off completely"))
+        self.laptopClosedShutdown.setText(self.__tr("Shutdown"))
+        QToolTip.add(self.laptopClosedShutdown,self.__tr("Halt the machine"))
+
+
+    def __tr(self,s,c = None):
+        return qApp.translate("PowerManagerUI",s,c)
+
+if __name__ == "__main__":
+    appname     = ""
+    description = ""
+    version     = ""
+
+    KCmdLineArgs.init (sys.argv, appname, description, version)
+    a = KApplication ()
+
+    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
+    w = PowerManagerUI()
+    a.setMainWidget(w)
+    w.show()
+    a.exec_loop()

Reply via email to