~x1101/+junk/heybuddy

« back to all changes in this revision

Viewing changes to Notify.py

  • Committer: x1101
  • Date: 2010-10-17 21:48:31 UTC
  • Revision ID: ljmckarns@gmail.com-20101017214831-k7qu28uz7q1koxod
pushing standard before new changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
class Notify():
14
14
        def __init__(self):
15
 
                pynotify.init("Heybuddy")
16
 
 
17
 
        def foo_cb(n, action):
18
 
                print "button clicked"
19
 
                n.close()
 
15
                pynotify.init('Heybuddy')
20
16
 
21
17
        def notify_send(self,summary,content):
22
18
                summary=summary
23
19
                content=content
24
20
                notify=pynotify.Notification(summary,content)
25
21
                if not notify.show():
26
 
                        print "Failed to show notification"
 
22
                        print _("Failed to show notification")
27
23
 
28
24
        def notify_updates(self,num_updates):
29
 
                summary="New updates in timeline"
30
 
                content="%d new dents in timeline" % (num_updates)
 
25
                summary=_("New updates in timeline")
 
26
                content=_("%d new dents in timeline") % (num_updates)
31
27
                self.notify_send(summary,content)
32
28
 
33
29
        def notify_reply(self,name,message):
34
 
                summary="%s wrote:" % (name)
 
30
                summary=_("%s wrote:") % (name)
35
31
                content=message
36
32
                self.notify_send(summary,content)
37
33
                
38
34
        def notify(self,updates,replies):
39
 
                summary="New updates in timeline"
40
 
                content="%d new dents in timeline, %d new @replies" % (updates,replies)
 
35
                summary=_("New updates in timeline")
 
36
                content=_("%d new dents in timeline, %d new @replies") % (updates,replies)
41
37
                self.notify_send(summary,content)
42
38
 
43
39