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
=== modified file 'pomidor/PomidorWindow.py'
--- pomidor/PomidorWindow.py 2013-04-11 15:36:08 +0000
+++ pomidor/PomidorWindow.py 2013-04-14 12:37:26 +0000
@@ -7,7 +7,7 @@
7from gettext import gettext as _7from gettext import gettext as _
8gettext.textdomain('pomidor')8gettext.textdomain('pomidor')
99
10from gi.repository import Gtk, GObject, Unity # pylint: disable=E061110from gi.repository import GObject, Unity, Notify # pylint: disable=E0611
11import logging11import logging
12logger = logging.getLogger('pomidor')12logger = logging.getLogger('pomidor')
1313
@@ -16,7 +16,6 @@
16#from pomidor.PreferencesPomidorDialog import PreferencesPomidorDialog16#from pomidor.PreferencesPomidorDialog import PreferencesPomidorDialog
1717
18from pomidor import pycanberra18from pomidor import pycanberra
19import subprocess
2019
21zeit_mark = "<span font_desc='59.0'>%02i:%02i</span>"20zeit_mark = "<span font_desc='59.0'>%02i:%02i</span>"
2221
@@ -100,15 +99,25 @@
100 self.minimizeonclicked = 1 # alow minimizing when timer is activated99 self.minimizeonclicked = 1 # alow minimizing when timer is activated
101100
102 return True101 return True
103 self.loop.run()
104102
105103
106class Salert():104class Salert():
105 """ Show a notification using libnotify, and play a soun using pycanberra. """
106
107 image = "file:///usr/share/pomidor/media/pomidor.svg"
108
109 def __init__(self):
110 """ Make sure Notify is initted """
111 if not Notify.is_initted():
112 Notify.init("Pomidor")
107113
108 def play(self):114 def play(self):
109 # Message115 # Show notification
110 subprocess.Popen("notify-send -i /usr/share/pomidor/media/pomidor.svg 'Pomidor Time Manager' 'Time is up!'", shell=True)116 n = Notify.Notification.new(_("Pomidor Time Manager"), _("Time is up!"), self.image)
111 # Sound117 if not n.show():
118 raise Exception(_("Could not show notification..."))
119
120 # Play a sound
112 canberra = pycanberra.Canberra()121 canberra = pycanberra.Canberra()
113 canberra.easy_play_sync("service-login")122 canberra.easy_play_sync("service-login")
114 canberra.destroy()
115\ No newline at end of file123\ No newline at end of file
124 canberra.destroy()

Subscribers

People subscribed via source and target branches

to all changes: