labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1500205 - in /labs/panopticon/src/asf/utils: auth.py emails.py
Date Sat, 06 Jul 2013 05:27:09 GMT
Author: adc
Date: Sat Jul  6 05:27:09 2013
New Revision: 1500205

URL: http://svn.apache.org/r1500205
Log:
Config throws NoOptionError not returns None

Modified:
    labs/panopticon/src/asf/utils/auth.py
    labs/panopticon/src/asf/utils/emails.py

Modified: labs/panopticon/src/asf/utils/auth.py
URL: http://svn.apache.org/viewvc/labs/panopticon/src/asf/utils/auth.py?rev=1500205&r1=1500204&r2=1500205&view=diff
==============================================================================
--- labs/panopticon/src/asf/utils/auth.py (original)
+++ labs/panopticon/src/asf/utils/auth.py Sat Jul  6 05:27:09 2013
@@ -28,6 +28,7 @@
 
   Note that the OS X keychain is always available on OS X.
 """
+from ConfigParser import NoOptionError
 import getpass
 from logging import getLogger
 import os
@@ -119,8 +120,9 @@ def clear_username_from_store():
 def get_username(use_store=False):
     if use_store:
         with load_config(AUTH_SECTIONS, AUTH_CONFIG_DEFAULTS) as config:
-            username = config.get(AUTH_SECTION, 'username')
-            if not username:
+            try:
+                username = config.get(AUTH_SECTION, 'username')
+            except NoOptionError:
                 username = raw_input("Username [%s]: " % getpass.getuser())
                 if not username:
                     username = getpass.getuser()

Modified: labs/panopticon/src/asf/utils/emails.py
URL: http://svn.apache.org/viewvc/labs/panopticon/src/asf/utils/emails.py?rev=1500205&r1=1500204&r2=1500205&view=diff
==============================================================================
--- labs/panopticon/src/asf/utils/emails.py (original)
+++ labs/panopticon/src/asf/utils/emails.py Sat Jul  6 05:27:09 2013
@@ -20,8 +20,8 @@
 Provides access to https://id.apache.org/info/MailAlias.txt.
 """
 from collections import defaultdict
-from restkit import BasicAuth, Resource
 
+from restkit import BasicAuth, Resource
 from brownie.caching import memoize
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message