~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to recent_notifications/Notification.py

  • Committer: Jason Conti
  • Date: 2010-03-08 18:16:22 UTC
  • Revision ID: jason.conti@gmail.com-20100308181622-gd3xbvuoxtpzjn69
Tags: 0.4.6
Adding support for gettext translations and a pointless en_US translation as an example. Using distutils-extra to automatically build the translations and the bonobo server. Replaced the build_servers target with update_prefix. This performs basically the same as build_servers except that it will do the substitution on any .in file, and it just writes the output file without the .in, instead of adding it to the data file install list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
import time
16
16
 
17
17
from dbus.mainloop.glib import DBusGMainLoop
 
18
from locale import nl_langinfo, T_FMT
18
19
 
19
20
from Icon import load_icon, load_icon_from_file
20
21
 
95
96
 
96
97
    self.log_message()
97
98
 
 
99
  def formatted_timestamp(self):
 
100
    """Returned the timestamp in a different format."""
 
101
    #return time.strftime("%I:%M:%S %p", self.timestamp)
 
102
    return time.strftime(nl_langinfo(T_FMT), self.timestamp)
 
103
 
98
104
  def get_icon(self, size = 48):
99
105
    """Loads the icon into a pixbuf. Adapted from the load_icon code in
100
106
    bubble.c of notify-osd."""
127
133
    else:
128
134
      return load_icon("notification-normal", size)
129
135
 
130
 
  def formatted_timestamp(self):
131
 
    """Returned the timestamp in a different format."""
132
 
    return time.strftime("%I:%M:%S %p", self.timestamp)
133
 
 
134
136
  def log_message(self):
135
137
    """Write debug info about a message."""
136
138
    result = [