summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-02-13 16:58:23 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-02-13 16:58:23 +0200
commitf1083a85a9cc5bf43021b2b51d352ac814a17280 (patch)
treec1a1c53f8a28392fbad67eb29de8768db44b5baa
parent15b5aceecfb12f46684e609905b1e4f523956472 (diff)
Switch strings to use .format()
Update .pot methods -> properties
-rw-r--r--po/valosoitin.pot16
-rwxr-xr-xvalosoitin/Valosoitin.py13
-rw-r--r--valosoitin/gui/controls.py20
3 files changed, 21 insertions, 28 deletions
diff --git a/po/valosoitin.pot b/po/valosoitin.pot
index 78ee49b..ccef03f 100644
--- a/po/valosoitin.pot
+++ b/po/valosoitin.pot
@@ -8,7 +8,7 @@ msgid ""
8msgstr "" 8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n" 9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n" 10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-02-12 15:12+0200\n" 11"POT-Creation-Date: 2013-02-13 16:56+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n" 14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -50,27 +50,23 @@ msgid "Select the tracks you wish to remove and press Remove when done."
50msgstr "" 50msgstr ""
51 51
52#: ../valosoitin/Valosoitin.py:542 52#: ../valosoitin/Valosoitin.py:542
53#, python-format 53msgid "title <b>{0}</b>"
54msgid "title <b>%s</b>"
55msgstr "" 54msgstr ""
56 55
57#: ../valosoitin/Valosoitin.py:543 56#: ../valosoitin/Valosoitin.py:543
58#, python-format 57msgid "by <i>{0}</i>"
59msgid "by <i>%s</i>"
60msgstr "" 58msgstr ""
61 59
62#: ../valosoitin/Valosoitin.py:544 60#: ../valosoitin/Valosoitin.py:544
63#, python-format 61msgid "from the album <b>{0}</b>"
64msgid "from the album <b>%s</b>"
65msgstr "" 62msgstr ""
66 63
67#: ../valosoitin/Valosoitin.py:552 64#: ../valosoitin/Valosoitin.py:552
68msgid "You're listening to" 65msgid "You're listening to"
69msgstr "" 66msgstr ""
70 67
71#: ../valosoitin/Valosoitin.py:600 68#: ../valosoitin/Valosoitin.py:603
72#, python-format 69msgid "No results for {0}"
73msgid "No results for %s"
74msgstr "" 70msgstr ""
75 71
76#: ../valosoitin/gui/controls.py:77 72#: ../valosoitin/gui/controls.py:77
diff --git a/valosoitin/Valosoitin.py b/valosoitin/Valosoitin.py
index db32a90..27e7d70 100755
--- a/valosoitin/Valosoitin.py
+++ b/valosoitin/Valosoitin.py
@@ -191,7 +191,7 @@ class Valosoitin(object):
191 self.dbusname = dbus.service.BusName("org.mpris.MediaPlayer2.Valosoitin", dbus.SessionBus()) 191 self.dbusname = dbus.service.BusName("org.mpris.MediaPlayer2.Valosoitin", dbus.SessionBus())
192 self.dbo = ValosoitinDBus(self) 192 self.dbo = ValosoitinDBus(self)
193 193
194 window.resize(400, 400) 194 window.resize(480, 480)
195 window.show() 195 window.show()
196 196
197 # Restore playlist 197 # Restore playlist
@@ -539,9 +539,9 @@ class Valosoitin(object):
539 artists = cgi.escape(", ".join(m.get("artist"))) if m.get("artist") else "" 539 artists = cgi.escape(", ".join(m.get("artist"))) if m.get("artist") else ""
540 albums = cgi.escape(", ".join(m.get("album"))) if m.get("album") else "" 540 albums = cgi.escape(", ".join(m.get("album"))) if m.get("album") else ""
541 541
542 self.audioinfo.title.text = _("title <b>%s</b>") % (titles) 542 self.audioinfo.title.text = _("title <b>{0}</b>").format(titles)
543 self.audioinfo.artist.text = _("by <i>%s</i>") % (artists) if artists else "" 543 self.audioinfo.artist.text = _("by <i>{0}</i>").format(artists) if artists else ""
544 self.audioinfo.album.text = _("from the album <b>%s</b>") % (albums) if albums else "" 544 self.audioinfo.album.text = _("from the album <b>{0}</b>").format(albums) if albums else ""
545 545
546 self.dbo.playerprops["Metadata"]["mpris:trackid"] = f 546 self.dbo.playerprops["Metadata"]["mpris:trackid"] = f
547 547
@@ -597,13 +597,10 @@ class Valosoitin(object):
597 if result: 597 if result:
598 cb(string, ordered_result) 598 cb(string, ordered_result)
599 else: 599 else:
600 e = _("No results for %s") % (string)
601
602 if e:
603 n = elm.Notify(self.window) 600 n = elm.Notify(self.window)
604 n.orient = elm.ELM_NOTIFY_ORIENT_TOP 601 n.orient = elm.ELM_NOTIFY_ORIENT_TOP
605 l = elm.Label(self.window) 602 l = elm.Label(self.window)
606 l.text = e 603 l.text = _("No results for {0}").format(string)
607 n.content = l 604 n.content = l
608 n.timeout = 2.0 605 n.timeout = 2.0
609 n.show() 606 n.show()
diff --git a/valosoitin/gui/controls.py b/valosoitin/gui/controls.py
index d57d71e..b0c1a0f 100644
--- a/valosoitin/gui/controls.py
+++ b/valosoitin/gui/controls.py
@@ -83,7 +83,7 @@ class VolumeControls(elm.Frame):
83 mute.show() 83 mute.show()
84 84
85 self.volume = volume = elm.Slider(window) 85 self.volume = volume = elm.Slider(window)
86 volume.min_max_set(0.0, 100.0) 86 volume.min_max = 0.0, 100.0
87 volume.indicator_format_set("%.0f%") 87 volume.indicator_format_set("%.0f%")
88 try: 88 try:
89 volume.value = parent.conf.getfloat("Settings", "volume") 89 volume.value = parent.conf.getfloat("Settings", "volume")
@@ -91,15 +91,15 @@ class VolumeControls(elm.Frame):
91 pass 91 pass
92 volume.disabled = mute.state 92 volume.disabled = mute.state
93 volume.callback_changed_add(self.volume_cb, parent) 93 volume.callback_changed_add(self.volume_cb, parent)
94 volume.size_hint_weight_set(1.0, 0.0) 94 volume.size_hint_weight = 1.0, 0.0
95 volume.size_hint_align_set(-1.0, 0.0) 95 volume.size_hint_align = -1.0, 0.0
96 volume.show() 96 volume.show()
97 97
98 self.size_hint_align_set(-1.0, 0.0) 98 self.size_hint_align = -1.0, 0.0
99 volumebox = elm.Box(window) 99 volumebox = elm.Box(window)
100 volumebox.horizontal_set(True) 100 volumebox.horizontal = True
101 volumebox.size_hint_weight_set(1.0, 0.0) 101 volumebox.size_hint_weight = 1.0, 0.0
102 volumebox.size_hint_align_set(-1.0, 0.0) 102 volumebox.size_hint_align = -1.0, 0.0
103 volumebox.pack_end(mute) 103 volumebox.pack_end(mute)
104 volumebox.pack_end(volume) 104 volumebox.pack_end(volume)
105 volumebox.show() 105 volumebox.show()
@@ -121,7 +121,7 @@ class PlayModes(elm.Frame):
121 self.single = single = elm.Check(window) 121 self.single = single = elm.Check(window)
122 single.text = _("Single") 122 single.text = _("Single")
123 try: 123 try:
124 single.state_set(parent.conf.getboolean("Settings", "single")) 124 single.state = parent.conf.getboolean("Settings", "single")
125 except: 125 except:
126 pass 126 pass
127 single.callback_changed_add(self.single_cb, parent) 127 single.callback_changed_add(self.single_cb, parent)
@@ -130,7 +130,7 @@ class PlayModes(elm.Frame):
130 self.random = random = elm.Check(window) 130 self.random = random = elm.Check(window)
131 random.text = _("Random") 131 random.text = _("Random")
132 try: 132 try:
133 random.state_set(parent.conf.getboolean("Settings", "random")) 133 random.state = parent.conf.getboolean("Settings", "random")
134 except: 134 except:
135 pass 135 pass
136 random.callback_changed_add(self.random_cb, parent) 136 random.callback_changed_add(self.random_cb, parent)
@@ -139,7 +139,7 @@ class PlayModes(elm.Frame):
139 self.repeat = repeat = elm.Check(window) 139 self.repeat = repeat = elm.Check(window)
140 repeat.text = _("Repeat") 140 repeat.text = _("Repeat")
141 try: 141 try:
142 repeat.state_set(parent.conf.getboolean("Settings", "repeat")) 142 repeat.state = parent.conf.getboolean("Settings", "repeat")
143 except: 143 except:
144 pass 144 pass
145 repeat.callback_changed_add(self.repeat_cb, parent) 145 repeat.callback_changed_add(self.repeat_cb, parent)