~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to notifications.py

  • Committer: Jason Conti
  • Date: 2010-02-17 23:42:56 UTC
  • Revision ID: jason.conti@gmail.com-20100217234256-fjv8d9uyw3wxsf2c
Adding MessageWidget to display the messages in a MessageWindow. Also includes lots of changes to MessageWindow, and LogWatcher.py, rewriting logtracker.py to use gio instead of inotify, allowing the use of signals to update about changes instead of a separate thread, which doesn't seem to be working.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    """Appends a body line to the message."""
43
43
    self.body += body
44
44
 
 
45
  def formatted_time(self):
 
46
    """Returned the time in a different format."""
 
47
    t = time.strptime(self.timestamp.upper(), "%Y-%m-%dT%H:%M:%S-00:00")
 
48
    return time.strftime("%A, %B %d, %Y at %I:%M:%S %p", t)
 
49
 
45
50
  def display(self):
46
51
    """Prints the message"""
47
52
    print "-"*50
48
 
    print "Timestamp:", self.timestamp
 
53
    print "Timestamp:", self.formatted_time()
49
54
    print "Process Name:", self.process_name
50
55
    print "Status:", self.status
51
56
    print "Title:", self.title