From 898128b9f449431886420710b571eacebbb6dd4b Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 11 Jul 2012 12:10:05 +0300 Subject: [PATCH] contib/nmbug/nmbug-status: leftover whitespaces, indentation & quoting The initial nmbug-status was pretty consistent in it's whitespacing but a few lines had some leftover slips. Those are now "corrected". Also, most of the code used ' as quoting char. As in Python one can use ' and " interchangeably some code used " instead of '. However the usage of those were inconsistent. Now all quotes that python parses are ':s (only quoted content uses ":s). No functional changes. --- contrib/nmbug/nmbug-status | 43 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/contrib/nmbug/nmbug-status b/contrib/nmbug/nmbug-status index 8c6377e5..f37ee84b 100755 --- a/contrib/nmbug/nmbug-status +++ b/contrib/nmbug/nmbug-status @@ -18,10 +18,10 @@ import subprocess # parse command line arguments parser = argparse.ArgumentParser() -parser.add_argument("--text", help="output plain text format", - action="store_true") +parser.add_argument('--text', help='output plain text format', + action='store_true') -parser.add_argument("--config", help="load config from given file") +parser.add_argument('--config', help='load config from given file') args = parser.parse_args() @@ -31,18 +31,18 @@ args = parser.parse_args() if args.config != None: fp = open(args.config) else: - nmbhome = os.getenv('NMBGIT', os.path.expanduser("~/.nmbug")) + nmbhome = os.getenv('NMBGIT', os.path.expanduser('~/.nmbug')) # read only the first line from the pipe - sha1 = subprocess.Popen(['git', '--git-dir', nmbhome, - 'show-ref', '-s', 'config'], - stdout=subprocess.PIPE).stdout.readline() + sha1 = subprocess.Popen(['git', '--git-dir', nmbhome, + 'show-ref', '-s', 'config'], + stdout=subprocess.PIPE).stdout.readline() sha1 = sha1.rstrip() - fp = subprocess.Popen(['git', '--git-dir', nmbhome, - 'cat-file', 'blob', sha1+':status-config.json'], - stdout=subprocess.PIPE).stdout + fp = subprocess.Popen(['git', '--git-dir', nmbhome, + 'cat-file', 'blob', sha1+':status-config.json'], + stdout=subprocess.PIPE).stdout config = json.load(fp) @@ -60,11 +60,10 @@ def clear_last(): def print_view(title, query, comment): - query_string = " and ".join(query) + query_string = ' and '.join(query) q_new = notmuch.Query(db, query_string) q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST) - last['thread_id'] = '' if output_format == 'html': @@ -94,7 +93,7 @@ def print_view(title, query, comment): val = rfc822.parseaddr(val)[0] if last[header] == val: - out[header] = "" + out[header] = '' else: out[header] = val.encode('utf-8') last[header] = val @@ -108,16 +107,16 @@ def print_view(title, query, comment): br = '
' else: br = '' - + out['subject'] = '%s' \ - % (urllib.quote(mid), out['subject']) - - print " %s %s" % (br, out['date']) - print "%s %s" % (br, out['id']) - print "" - print " %s" % out['from'] - print "%s" % out['subject'] - print "\n" + % (urllib.quote(mid), out['subject']) + + print ' %s %s' % (br, out['date']) + print '%s %s' % (br, out['id']) + print '' + print ' %s' % out['from'] + print '%s' % out['subject'] + print '\n' else: print '%(date)-10.10s %(from)-20.20s %(subject)-40.40s\n%(id)72s\n' % out -- 2.43.0