[Inteproxy-commits] r66 - in trunk: . inteproxy

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 27 17:43:31 CEST 2007


Author: bh
Date: 2007-04-27 17:43:31 +0200 (Fri, 27 Apr 2007)
New Revision: 66

Modified:
   trunk/ChangeLog
   trunk/inteproxy/getpassword.py
Log:
* inteproxy/getpassword.py: Remove the code for the non-gtk user
interface:
(getpassword_pywin, getpassword_tty): removed.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-04-26 19:04:26 UTC (rev 65)
+++ trunk/ChangeLog	2007-04-27 15:43:31 UTC (rev 66)
@@ -1,3 +1,9 @@
+2007-04-27  Bernhard Herzog  <bh at intevation.de>
+
+	* inteproxy/getpassword.py: Remove the code for the non-gtk user
+	interface:
+	(getpassword_pywin, getpassword_tty): removed.
+
 2007-04-26  Bernhard Herzog  <bh at intevation.de>
 
 	* inteproxy/app.py: New.  Base application class.

Modified: trunk/inteproxy/getpassword.py
===================================================================
--- trunk/inteproxy/getpassword.py	2007-04-26 19:04:26 UTC (rev 65)
+++ trunk/inteproxy/getpassword.py	2007-04-27 15:43:31 UTC (rev 66)
@@ -10,26 +10,12 @@
 import threading
 import traceback
 
+import gtk
+
 import inteproxy.main
 
-# Determine the window system we're using.  This determines how the user
-# is asked for the username/password.
-try:
-    # If gtk isn't available, we get an ImportError here.  However, on
-    # Unix, if we gtk cannot establish the connection to the X-server,
-    # we get a RuntimeError here.  We do not catch the RuntimeError for
-    # now, because we want to use gtk by default and don't want to hide
-    # configuration errors like missing or incorrect DISPLAY variables.
-    import gtk
-    windowsystem = "gtk"
-except ImportError:
-    try:
-        import pywin.dialogs.login
-        windowsystem = "pywin"
-    except ImportError:
-        windowsystem = "tty"
 
-def getpassword_gtk(title):
+def getpassword(title):
     dialog = gtk.Dialog("My dialog", None,
                         gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                         (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
@@ -72,22 +58,7 @@
 
     return result
 
-def getpassword_pywin(title):
-    return pywin.dialogs.login.GetLogin(title)
 
-def getpassword_tty(title):
-    import getpass
-    try:
-        user = raw_input(title)
-        password = getpass.getpass()
-    except IOError:
-        import traceback
-        traceback.print_exception()
-        user = password = None
-    return user, password
-
-getpassword = globals()["getpassword_" + windowsystem]
-
 # password cache and lock
 pw_cache = {}
 pw_lock = threading.Lock()



More information about the Inteproxy-commits mailing list