Merge lp:~jaapz-b/pomidor/notify into lp:~dkotrada/pomidor/0.1

Proposed by Jaap Broekhuizen
Status: Merged
Merge reported by: dkotrada
Merged at revision: not available
Proposed branch: lp:~jaapz-b/pomidor/notify
Merge into: lp:~dkotrada/pomidor/0.1
Diff against target: 52 lines (+16/-7)
1 file modified
pomidor/PomidorWindow.py (+16/-7)
To merge this branch: bzr merge lp:~jaapz-b/pomidor/notify
Reviewer Review Type Date Requested Status
dkotrada Pending
Review via email: mp+158781@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jaap Broekhuizen (jaapz-b) wrote :

Though the status says "merged" it is, in fact, not merged... Why?

Revision history for this message
dkotrada (dkotrada) wrote :

Because I don't know how to do it. I done it manually at
http://bazaar.launchpad.net/~dkotrada/pomidor/0.1/revision/23

and self.loop() I removed at later revisions because I read your comments
later.

I never worked together on one code with another person in launchpad

2013/4/15 Jaap Broekhuizen <email address hidden>

> Though the status says "merged" it is, in fact, not merged... Why?
> --
> https://code.launchpad.net/~jaapz-b/pomidor/notify/+merge/158781
> You are requested to review the proposed merge of
> lp:~jaapz-b/pomidor/notify into lp:pomidor.
>

Revision history for this message
dkotrada (dkotrada) wrote :

Here is the self.loop() removed
http://bazaar.launchpad.net/~dkotrada/pomidor/0.1/revision/25

2013/4/15 Jaap Broekhuizen <email address hidden>

> Though the status says "merged" it is, in fact, not merged... Why?
> --
> https://code.launchpad.net/~jaapz-b/pomidor/notify/+merge/158781
> You are requested to review the proposed merge of
> lp:~jaapz-b/pomidor/notify into lp:pomidor.
>

Revision history for this message
dkotrada (dkotrada) wrote :

Here is the self.loop() removed
http://bazaar.launchpad.net/~dkotrada/pomidor/0.1/revision/25

2013/4/14 Jaap Broekhuizen <email address hidden>

> Jaap Broekhuizen has proposed merging lp:~jaapz-b/pomidor/notify into
> lp:pomidor.
>
> Requested reviews:
> dkotrada (dkotrada)
> Related bugs:
> Bug #1168869 in pomidor: "Use Notify from gir instead of notify-send"
> https://bugs.launchpad.net/pomidor/+bug/1168869
>
> For more details, see:
> https://code.launchpad.net/~jaapz-b/pomidor/notify/+merge/158781
> --
> https://code.launchpad.net/~jaapz-b/pomidor/notify/+merge/158781
> You are requested to review the proposed merge of
> lp:~jaapz-b/pomidor/notify into lp:pomidor.
>
> === modified file 'pomidor/PomidorWindow.py'
> --- pomidor/PomidorWindow.py 2013-04-11 15:36:08 +0000
> +++ pomidor/PomidorWindow.py 2013-04-14 12:32:25 +0000
> @@ -7,7 +7,7 @@
> from gettext import gettext as _
> gettext.textdomain('pomidor')
>
> -from gi.repository import Gtk, GObject, Unity # pylint: disable=E0611
> +from gi.repository import GObject, Unity, Notify # pylint: disable=E0611
> import logging
> logger = logging.getLogger('pomidor')
>
> @@ -16,7 +16,6 @@
> #from pomidor.PreferencesPomidorDialog import PreferencesPomidorDialog
>
> from pomidor import pycanberra
> -import subprocess
>
> zeit_mark = "<span font_desc='59.0'>%02i:%02i</span>"
>
> @@ -100,15 +99,25 @@
> self.minimizeonclicked = 1 # alow minimizing when timer
> is activated
>
> return True
> - self.loop.run()
>
>
> class Salert():
> + """ Show a notification using libnotify, and play a soun using
> pycanberra. """
> +
> + image = "file:///usr/share/pomidor/media/pomidor.svg"
> +
> + def __init__(self):
> + """ Make sure Notify is initted """
> + if not Notify.is_initted():
> + Notify.init("Pomidor")
>
> def play(self):
> - # Message
> - subprocess.Popen("notify-send -i
> /usr/share/pomidor/media/pomidor.svg 'Pomidor Time Manager' 'Time is up!'",
> shell=True)
> - # Sound
> + # Show notification
> + n = Notify.Notification.new(_("Pomidor Time Manager"), _("Time is
> up!"), self.image)
> + if not n.show():
> + raise Exception(_("Could not show notification..."))
> +
> + # Play a sound
> canberra = pycanberra.Canberra()
> canberra.easy_play_sync("service-login")
> - canberra.destroy()
> \ No newline at end of file
> + canberra.destroy()
>
>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pomidor/PomidorWindow.py'
2--- pomidor/PomidorWindow.py 2013-04-11 15:36:08 +0000
3+++ pomidor/PomidorWindow.py 2013-04-14 12:37:26 +0000
4@@ -7,7 +7,7 @@
5 from gettext import gettext as _
6 gettext.textdomain('pomidor')
7
8-from gi.repository import Gtk, GObject, Unity # pylint: disable=E0611
9+from gi.repository import GObject, Unity, Notify # pylint: disable=E0611
10 import logging
11 logger = logging.getLogger('pomidor')
12
13@@ -16,7 +16,6 @@
14 #from pomidor.PreferencesPomidorDialog import PreferencesPomidorDialog
15
16 from pomidor import pycanberra
17-import subprocess
18
19 zeit_mark = "<span font_desc='59.0'>%02i:%02i</span>"
20
21@@ -100,15 +99,25 @@
22 self.minimizeonclicked = 1 # alow minimizing when timer is activated
23
24 return True
25- self.loop.run()
26
27
28 class Salert():
29+ """ Show a notification using libnotify, and play a soun using pycanberra. """
30+
31+ image = "file:///usr/share/pomidor/media/pomidor.svg"
32+
33+ def __init__(self):
34+ """ Make sure Notify is initted """
35+ if not Notify.is_initted():
36+ Notify.init("Pomidor")
37
38 def play(self):
39- # Message
40- subprocess.Popen("notify-send -i /usr/share/pomidor/media/pomidor.svg 'Pomidor Time Manager' 'Time is up!'", shell=True)
41- # Sound
42+ # Show notification
43+ n = Notify.Notification.new(_("Pomidor Time Manager"), _("Time is up!"), self.image)
44+ if not n.show():
45+ raise Exception(_("Could not show notification..."))
46+
47+ # Play a sound
48 canberra = pycanberra.Canberra()
49 canberra.easy_play_sync("service-login")
50- canberra.destroy()
51\ No newline at end of file
52+ canberra.destroy()

Subscribers

People subscribed via source and target branches

to all changes: