From 25a05db31bd773df659aa30c7de31d25f232e5cf Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Fri, 30 Dec 2016 13:41:55 +0100 Subject: Remove unneeded expanduser calls Fixes the -n option. --- alot/__main__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'alot/__main__.py') diff --git a/alot/__main__.py b/alot/__main__.py index b55c9999..cc9dca4e 100644 --- a/alot/__main__.py +++ b/alot/__main__.py @@ -62,9 +62,8 @@ def main(): root_logger.removeHandler(log_handler) root_logger = None numeric_loglevel = getattr(logging, options.debug_level.upper(), None) - logfilename = os.path.expanduser(options.logfile) logformat = '%(levelname)s:%(module)s:%(message)s' - logging.basicConfig(level=numeric_loglevel, filename=logfilename, + logging.basicConfig(level=numeric_loglevel, filename=options.logfile, filemode='w', format=logformat) # locate alot config files @@ -78,10 +77,11 @@ def main(): alotconfig = options.config # locate notmuch config - notmuchpath = os.environ.get('NOTMUCH_CONFIG', '~/.notmuch-config') if options.notmuch_config: - notmuchpath = options.notmuch_config - notmuchconfig = os.path.expanduser(notmuchpath) + notmuchconfig = options.notmuch_config + else: + notmuchconfig = os.environ.get('NOTMUCH_CONFIG', + os.path.expanduser('~/.notmuch-config')) try: settings.read_config(alotconfig) -- cgit v1.2.3