Browse Source

Changed the message format to display favourite status

master
Julio Biason 15 years ago
parent
commit
4a81bcf87b
  1. 29
      mitterlib/ui/ui_pygtk.py

29
mitterlib/ui/ui_pygtk.py

@ -41,6 +41,15 @@ _log = logging.getLogger('ui.pygtk')
URL_RE = re.compile(r'(https?://[^\s\n\r]+)', re.I)
MESSAGE_FORMAT = '%s' \
'<b>%s</b>' \
'<small>(%s' \
'%s' \
'</small>:' \
'%s\n' \
'%s\n' \
'<small>%s</small>'
# ----------------------------------------------------------------------
# Helper Functions (not related to objects or that don't need direct access to
@ -578,15 +587,18 @@ class Interface(object):
else:
read_status = ''
if data.favourited:
favourited = '&#9733;'
else:
favourited = '&#9734;'
if data.reposted_by:
markup = '<b>%s</b> <small>(%s &#8212; <i>reposted by %s</i>)' \
'</small>:%s\n%s\n<small>%s</small>' % \
(data.name, username, data.reposted_by, read_status,
message, time)
reposted_message = ' &#8212; <i>reposted by %s</i>'
else:
markup = '<b>%s</b> <small>(%s)</small>:%s\n%s\n' \
'<small>%s</small>' % \
(data.name, username, read_status, message, time)
reposted_message = ''
markup = MESSAGE_FORMAT % (favourited, data.name, username,
reposted_message, read_status, message, time)
cell.set_property('markup', markup)
@ -1216,8 +1228,9 @@ class Interface(object):
metavar='MINUTES',
default=5,
conflict_group='interface')
options.add_option('--use-statusicon',
options.add_option('--disable-statusicon',
group=self.NAMESPACE,
action='store_false',
option='statusicon',
default=True,
conflict_group='interface')

Loading…
Cancel
Save