use IFormatter.(BOLD|NC) on every formatters

This commit is contained in:
Romain Bignon 2011-03-09 09:26:55 +01:00
commit bafbf3644a
6 changed files with 26 additions and 28 deletions

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
# Copyright(C) 2010-2011 Romain Bignon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -31,7 +31,7 @@ class ForecastsFormatter(IFormatter):
pass
def format_dict(self, item):
result = u'%s* %-15s%s (%s°%s - %s°%s)' % (ReplApplication.BOLD, '%s:' % item['date'], ReplApplication.NC, item['low'], item['unit'], item['high'], item['unit'])
result = u'%s* %-15s%s (%s°%s - %s°%s)' % (self.BOLD, '%s:' % item['date'], self.NC, item['low'], item['unit'], item['high'], item['unit'])
if 'text' in item and item['text']:
result += ' %s' % item['text']
return result
@ -48,7 +48,7 @@ class CurrentFormatter(IFormatter):
else:
date = item['date']
result = u'%s%s%s: %s' % (ReplApplication.BOLD, date, ReplApplication.NC, item['temp'])
result = u'%s%s%s: %s' % (self.BOLD, date, self.NC, item['temp'])
if 'unit' in item and item['unit']:
result += u'°%s' % item['unit']
if 'text' in item and item['text']:
@ -66,9 +66,9 @@ class CitiesFormatter(IFormatter):
self.count += 1
if self.interactive:
backend = item['id'].split('@', 1)[1]
result = u'%s* (%d) %s (%s)%s' % (ReplApplication.BOLD, self.count, item['name'], backend, ReplApplication.NC)
result = u'%s* (%d) %s (%s)%s' % (self.BOLD, self.count, item['name'], backend, self.NC)
else:
result = u'%s* (%s) %s%s' % (ReplApplication.BOLD, item['id'], item['name'], ReplApplication.NC)
result = u'%s* (%s) %s%s' % (self.BOLD, item['id'], item['name'], self.NC)
return result
class WetBoobs(ReplApplication):