# HG changeset patch # User Brian Neal # Date 1337452464 18000 # Node ID ce84c480ffecde85c0dba2ae23c445fe534b2035 # Parent e0a6a02b3213c8e57c5d2b15460092201dfe8428 Added a folder option. diff -r e0a6a02b3213 -r ce84c480ffec weighmail/config.py --- a/weighmail/config.py Fri May 18 20:32:21 2012 -0500 +++ b/weighmail/config.py Sat May 19 13:34:24 2012 -0500 @@ -4,6 +4,7 @@ DEFAULTS = dict( + folder='[Gmail]/All Mail', user=None, password=None, host='imap.gmail.com', @@ -24,8 +25,9 @@ parser.readfp(fp) # Build a list of label named tuples + ignore_sections = ['options', 'auth', 'connection'] - sections = [s for s in parser.sections() if s not in ('auth', 'connection')] + sections = [s for s in parser.sections() if s not in ignore_sections] labels = [make_label(sec, parser.get(sec, 'min'), @@ -34,6 +36,7 @@ # Build an options object and return it opts = dict( + folder=parser.get('options', 'folder'), user=parser.get('auth', 'user'), password=parser.get('auth', 'password'), host=parser.get('connection', 'host'), diff -r e0a6a02b3213 -r ce84c480ffec weighmail/main.py --- a/weighmail/main.py Fri May 18 20:32:21 2012 -0500 +++ b/weighmail/main.py Sat May 19 13:34:24 2012 -0500 @@ -33,6 +33,7 @@ epilog="Command-line arguments override config file settings.") parser.add_argument('-c', '--config', help="path to configuration file") + parser.add_argument('-f', '--folder', help="mail folder to search") parser.add_argument('-u', '--user', help="user name") parser.add_argument('-p', '--password', help="password") parser.add_argument('-H', '--host', help="server name")