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.
This commit is contained in:
Tomi Ollila 2012-07-11 12:10:05 +03:00 committed by David Bremner
parent 620092001e
commit 898128b9f4

View file

@ -18,10 +18,10 @@ import subprocess
# parse command line arguments # parse command line arguments
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--text", help="output plain text format", parser.add_argument('--text', help='output plain text format',
action="store_true") 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() args = parser.parse_args()
@ -31,7 +31,7 @@ args = parser.parse_args()
if args.config != None: if args.config != None:
fp = open(args.config) fp = open(args.config)
else: 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 # read only the first line from the pipe
sha1 = subprocess.Popen(['git', '--git-dir', nmbhome, sha1 = subprocess.Popen(['git', '--git-dir', nmbhome,
@ -60,11 +60,10 @@ def clear_last():
def print_view(title, query, comment): 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 = notmuch.Query(db, query_string)
q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST) q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
last['thread_id'] = '' last['thread_id'] = ''
if output_format == 'html': if output_format == 'html':
@ -94,7 +93,7 @@ def print_view(title, query, comment):
val = rfc822.parseaddr(val)[0] val = rfc822.parseaddr(val)[0]
if last[header] == val: if last[header] == val:
out[header] = "" out[header] = ''
else: else:
out[header] = val.encode('utf-8') out[header] = val.encode('utf-8')
last[header] = val last[header] = val
@ -112,12 +111,12 @@ def print_view(title, query, comment):
out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \ out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \
% (urllib.quote(mid), out['subject']) % (urllib.quote(mid), out['subject'])
print " <tr><td>%s %s" % (br, out['date']) print ' <tr><td>%s %s' % (br, out['date'])
print "</td><td>%s %s" % (br, out['id']) print '</td><td>%s %s' % (br, out['id'])
print "</td></tr>" print '</td></tr>'
print " <tr><td>%s" % out['from'] print ' <tr><td>%s' % out['from']
print "</td><td>%s" % out['subject'] print '</td><td>%s' % out['subject']
print "</td></tr>\n" print '</td></tr>\n'
else: else:
print '%(date)-10.10s %(from)-20.20s %(subject)-40.40s\n%(id)72s\n' % out print '%(date)-10.10s %(from)-20.20s %(subject)-40.40s\n%(id)72s\n' % out