diff -Nru python-keyring-0.5.1/debian/changelog python-keyring-0.5.1/debian/changelog --- python-keyring-0.5.1/debian/changelog 2011-03-03 18:48:34.000000000 +0500 +++ python-keyring-0.5.1/debian/changelog 2011-06-01 10:11:02.000000000 +0600 @@ -1,3 +1,17 @@ +python-keyring (0.5.1-2ubuntu0+abone1) natty; urgency=low + + * debian/patches/upstream-issue-41: Backport fix for upstream + issue 41 "KDEWallet not working in 0.5.1" + + -- Andrey Bondarenko Wed, 01 Jun 2011 10:08:58 +0600 + +python-keyring (0.5.1-2) unstable; urgency=low + + * Team upload. + * Rebuild to add Python 2.7 support + + -- Piotr Ożarowski Sun, 08 May 2011 16:45:30 +0200 + python-keyring (0.5.1-1) unstable; urgency=low * New upstream release (Closes: #612432) diff -Nru python-keyring-0.5.1/debian/patches/series python-keyring-0.5.1/debian/patches/series --- python-keyring-0.5.1/debian/patches/series 1970-01-01 05:00:00.000000000 +0500 +++ python-keyring-0.5.1/debian/patches/series 2011-06-01 10:04:28.000000000 +0600 @@ -0,0 +1 @@ +upstream-issue-41 diff -Nru python-keyring-0.5.1/debian/patches/upstream-issue-41 python-keyring-0.5.1/debian/patches/upstream-issue-41 --- python-keyring-0.5.1/debian/patches/upstream-issue-41 1970-01-01 05:00:00.000000000 +0500 +++ python-keyring-0.5.1/debian/patches/upstream-issue-41 2011-06-01 10:36:23.000000000 +0600 @@ -0,0 +1,89 @@ +Index: python-keyring~abone/keyring/backend.py +=================================================================== +--- python-keyring~abone.orig/keyring/backend.py 2011-06-01 10:07:37.755487913 +0600 ++++ python-keyring~abone/keyring/backend.py 2011-06-01 10:36:21.007997310 +0600 +@@ -164,7 +164,9 @@ + qt_module = QtGui + + # KDE wants us to instantiate an application object. +- app = qt_module.QApplication([]) ++ app = None ++ if qt_module.qApp.instance() == None: ++ app = qt_module.QApplication([]) + try: + window = QtGui.QWidget() + kwallet = kwallet_module.openWallet( +@@ -175,8 +177,10 @@ + if not kwallet.hasFolder('Python'): + kwallet.createFolder('Python') + kwallet.setFolder('Python') ++ return kwallet + finally: +- app.exit() ++ if app: ++ app.exit() + + + kwallet = None +Index: python-keyring~abone/keyring/tests/test_backend.py +=================================================================== +--- python-keyring~abone.orig/keyring/tests/test_backend.py 2011-06-01 10:07:37.771488289 +0600 ++++ python-keyring~abone/keyring/tests/test_backend.py 2011-06-01 10:32:49.431007267 +0600 +@@ -134,6 +134,11 @@ + class FauxQtGui(object): + """A fake module-like object used in testing the open_kwallet function.""" + ++ class qApp: ++ @staticmethod ++ def instance(): ++ pass ++ + class QApplication(object): + def __init__(self, *args): + pass +@@ -141,6 +146,12 @@ + def exit(self): + pass + ++ class QWidget(object): ++ def __init__(self, *args): ++ pass ++ ++ def winId(self): ++ pass + + class KDEWalletCanceledTestCase(unittest.TestCase): + +@@ -155,6 +166,23 @@ + None) + + ++class KDEKWalletInQApplication(unittest.TestCase): ++ ++ ++ def test_QApplication(self): ++ try: ++ from PyKDE4.kdeui import KWallet ++ from PyQt4.QtGui import QApplication ++ except: ++ return ++ ++ app = QApplication([]) ++ wallet=keyring.backend.open_kwallet() ++ self.assertTrue(isinstance(wallet,KWallet.Wallet),msg="The object wallet should be type but it is: %s"%repr(wallet)) ++ app.exit() ++ ++ ++ + class FileKeyringTestCase(BackendBasicTestCase): + __test__ = False + +@@ -227,6 +255,8 @@ + suite.addTest(unittest.makeSuite(OSXKeychainTestCase)) + suite.addTest(unittest.makeSuite(GnomeKeyringTestCase)) + suite.addTest(unittest.makeSuite(KDEKWalletTestCase)) ++ suite.addTest(unittest.makeSuite(KDEKWalletInQApplication)) ++ suite.addTest(unittest.makeSuite(KDEWalletCanceledTestCase)) + suite.addTest(unittest.makeSuite(UncryptedFileKeyringTestCase)) + suite.addTest(unittest.makeSuite(CryptedFileKeyringTestCase)) + suite.addTest(unittest.makeSuite(Win32CryptoKeyringTestCase))