diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-01-13 23:20:17 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-01-13 23:20:17 +0100 |
commit | 7509fb00021a0c550cee91d2feb27c1137dde916 (patch) | |
tree | bfc573c258d24cb73bdcd06ccc6459c4693121bc | |
parent | c94be4761a3182b212cf0d507974e200e8e020e8 (diff) | |
download | poezio-7509fb00021a0c550cee91d2feb27c1137dde916.tar.gz poezio-7509fb00021a0c550cee91d2feb27c1137dde916.tar.bz2 poezio-7509fb00021a0c550cee91d2feb27c1137dde916.tar.xz poezio-7509fb00021a0c550cee91d2feb27c1137dde916.zip |
Prompt password if no password is provided in config file
-rw-r--r-- | data/default_config.cfg | 1 | ||||
-rw-r--r-- | src/connection.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index 18493968..662fb44e 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -28,6 +28,7 @@ default_nick = jid = # A password is needed only if you specified a jid. It will be ignored otherwise +# If you leave this empty, the password will be asked at each startup password = # the rooms you will join automatically on startup, with associated nickname or not diff --git a/src/connection.py b/src/connection.py index d29fec82..d1de40d6 100644 --- a/src/connection.py +++ b/src/connection.py @@ -25,6 +25,7 @@ from gettext import (bindtextdomain, textdomain, bind_textdomain_codeset, gettext as _) import sys +import getpass import sleekxmpp from config import config @@ -43,7 +44,7 @@ class Connection(sleekxmpp.ClientXMPP): # many features will be handled diferently # depending on this setting jid = '%s/%s' % (config.get('jid', ''), resource) - password = config.get('password', '') + password = config.get('password', '') or getpass.getpass() else: # anonymous auth self.anon = True jid = '%s/%s' % (config.get('server', 'anon.louiz.org'), resource) |