[kupfer] plugin_support: Prefer gnomekeyring if it is available



commit aad2618dcf458719d051646d9e196824cfb306ed
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Apr 2 01:50:41 2011 +0200

    plugin_support: Prefer gnomekeyring if it is available
    
    Launchpad-bug: https://bugs.launchpad.net/kupfer/+bug/747864

 kupfer/plugin_support.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin_support.py b/kupfer/plugin_support.py
index 1b4d3d8..7ab0cab 100644
--- a/kupfer/plugin_support.py
+++ b/kupfer/plugin_support.py
@@ -1,9 +1,22 @@
+import sys
+
 import gobject
 
+## begin load python-keyring
+# if gnomekeyring exists, block kde libraries
+try:
+	import gnomekeyring
+except ImportError:
+	pass
+else:
+	sys.modules['PyKDE4'] = None
 try:
 	import keyring
 except ImportError:
 	keyring = None
+# now unblock kde libraries again
+sys.modules.pop('PyKDE4', None)
+## end load python-keyring
 
 
 from kupfer import pretty



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]