Merge lp:~dholbach/ubuntu-accomplishments-daemon/paths-fix into lp:~jonobacon/ubuntu-accomplishments-daemon/ubuntu-accomplishments-daemon

Proposed by Daniel Holbach
Status: Superseded
Proposed branch: lp:~dholbach/ubuntu-accomplishments-daemon/paths-fix
Merge into: lp:~jonobacon/ubuntu-accomplishments-daemon/ubuntu-accomplishments-daemon
Diff against target: 146 lines (+34/-19)
6 files modified
accomplishments/daemon/api.py (+3/-6)
accomplishments/util/paths.py (+11/-0)
bin/accomplishments-daemon (+9/-6)
debian/copyright (+1/-0)
po/accomplishments-daemon.pot (+5/-5)
setup.py (+5/-2)
To merge this branch: bzr merge lp:~dholbach/ubuntu-accomplishments-daemon/paths-fix
Reviewer Review Type Date Requested Status
Jono Bacon Pending
Review via email: mp+101340@code.launchpad.net

This proposal has been superseded by a proposal from 2012-04-10.

Description of the change

This should install the GPG key in the right place and tests where we are
running from (from branch or from system libs) when starting the daemon.

To post a comment you must log in.
117. By Daniel Holbach

update potfile

118. By Daniel Holbach

check for .png files in the right place depending on where we run the daemon from

119. By Daniel Holbach

merge from trunk

120. By Daniel Holbach

run daemon with -y instead of -noy

121. By Daniel Holbach

look for media files in media_dir - which depends on where we run the daemon from

Unmerged revisions

121. By Daniel Holbach

look for media files in media_dir - which depends on where we run the daemon from

120. By Daniel Holbach

run daemon with -y instead of -noy

119. By Daniel Holbach

merge from trunk

118. By Daniel Holbach

check for .png files in the right place depending on where we run the daemon from

117. By Daniel Holbach

update potfile

116. By Daniel Holbach

install gpg key into /usr/share/ and test if we are running from branch or not

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'accomplishments/daemon/api.py'
2--- accomplishments/daemon/api.py 2012-04-09 20:15:10 +0000
3+++ accomplishments/daemon/api.py 2012-04-10 08:26:18 +0000
4@@ -44,7 +44,7 @@
5 from accomplishments import exceptions
6 from accomplishments.daemon import dbusapi
7 from accomplishments.util import get_data_file, SubprocessReturnCodeProtocol
8-
9+from accomplishments.util.paths import media_dir
10
11 MATRIX_USERNAME = "openiduser155707"
12 LOCAL_USERNAME = getpass.getuser()
13@@ -543,9 +543,7 @@
14 os.remove(o)
15
16 # now generate our trophy images
17- lock_image_path = os.path.join(
18- os.path.dirname(accomplishments.__path__[0]),
19- "data/media/lock.png")
20+ lock_image_path = os.path.join(media_dir, "lock.png")
21 self.generate_trophy_images(
22 app_trophyimagespath, cache_trophyimagespath, lock_image_path)
23
24@@ -729,8 +727,7 @@
25 pynotify.is_initted() or pynotify.init("icon-summary-body")):
26 # XXX: need to fix loading the right icon
27 trophy_icon_path = "file://%s" % os.path.realpath(
28- os.path.join(
29- os.path.split(__file__)[0], "unlocked.png"))
30+ os.path.join(media_dir, "unlocked.png"))
31 n = pynotify.Notification(_("You have accomplished something!"),
32 data["title"], trophy_icon_path)
33 n.show()
34
35=== added file 'accomplishments/util/paths.py'
36--- accomplishments/util/paths.py 1970-01-01 00:00:00 +0000
37+++ accomplishments/util/paths.py 2012-04-10 08:26:18 +0000
38@@ -0,0 +1,11 @@
39+import os
40+
41+def uses_system_lib():
42+ return os.path.dirname(__file__).startswith("/usr")
43+
44+runs_in_branch = not uses_system_lib()
45+systemdata_dir = "data/daemon/"
46+media_dir = "data/media/"
47+if not runs_in_branch:
48+ systemdata_dir = "/usr/share/accomplishments-daemon/"
49+ media_dir = "/usr/share/accomplishments-daemon/media/"
50
51=== modified file 'bin/accomplishments-daemon'
52--- bin/accomplishments-daemon 2012-04-08 22:11:10 +0000
53+++ bin/accomplishments-daemon 2012-04-10 08:26:18 +0000
54@@ -1,8 +1,9 @@
55-#!/usr/bin/twistd
56+#!/usr/bin/twistd -noy
57 """
58 Run the Accomplishments daemon!
59 """
60 import sys
61+import os
62
63 from twisted.internet import glib2reactor
64 glib2reactor.install()
65@@ -11,10 +12,12 @@
66 from dbus.mainloop.glib import DBusGMainLoop
67
68 from accomplishments.daemon import app
69-
70-
71-# PYTHONPATH mangling
72-sys.path.insert(0, ".")
73+from accomplishments.util import paths
74+
75+
76+if paths.runs_in_branch:
77+ # PYTHONPATH mangling
78+ sys.path.insert(0, ".")
79
80 dbus_loop = DBusGMainLoop(set_as_default=True)
81 application = app.applicationFactory(
82@@ -25,4 +28,4 @@
83 object_path="/",
84 # Let's execute the timer service every 15 minutes
85 update_interval=15 * 60,
86- gpg_key="./data/daemon/validation-key.pub")
87+ gpg_key=os.path.join(paths.systemdata_dir, "validation-key.pub"))
88
89=== modified file 'debian/copyright'
90--- debian/copyright 2012-04-09 04:52:29 +0000
91+++ debian/copyright 2012-04-10 08:26:18 +0000
92@@ -5,6 +5,7 @@
93
94 Files: *
95 Copyright: (C) 2012 Jono Bacon <jono@ubuntu.com>
96+Copyright: (C) 2012 Rosetta Contributors and Canonical Ltd 2012
97 License: GPL-3
98 The full text of the GPL is distributed in
99 /usr/share/common-licenses/GPL-3 on Debian systems.
100
101=== modified file 'po/accomplishments-daemon.pot'
102--- po/accomplishments-daemon.pot 2012-04-09 06:08:40 +0000
103+++ po/accomplishments-daemon.pot 2012-04-10 08:26:18 +0000
104@@ -8,7 +8,7 @@
105 msgstr ""
106 "Project-Id-Version: PACKAGE VERSION\n"
107 "Report-Msgid-Bugs-To: \n"
108-"POT-Creation-Date: 2012-04-08 23:07-0700\n"
109+"POT-Creation-Date: 2012-04-10 10:21+0200\n"
110 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
111 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
112 "Language-Team: LANGUAGE <LL@li.org>\n"
113@@ -17,6 +17,10 @@
114 "Content-Type: text/plain; charset=CHARSET\n"
115 "Content-Transfer-Encoding: 8bit\n"
116
117+#: ../accomplishments/daemon/api.py:102 ../accomplishments/daemon/api.py:731
118+msgid "You have accomplished something!"
119+msgstr ""
120+
121 #: ../accomplishments/util/__init__.py:88
122 msgid "Show debug messages (-vv debugs accomplishments_daemon_lib also)"
123 msgstr ""
124@@ -24,7 +28,3 @@
125 #: ../accomplishments/util/__init__.py:91
126 msgid "Clear your trophies collection"
127 msgstr ""
128-
129-#: ../accomplishments/daemon/api.py:100 ../accomplishments/daemon/api.py:732
130-msgid "You have accomplished something!"
131-msgstr ""
132
133=== modified file 'setup.py'
134--- setup.py 2012-04-09 04:52:29 +0000
135+++ setup.py 2012-04-10 08:26:18 +0000
136@@ -15,5 +15,8 @@
137 description='Daemon for Ubuntu Accomplishments.',
138 long_description='Daemon for Ubuntu Accomplishments.',
139 url='https://launchpad.net/ubuntu-accomplishments-daemon',
140- cmdclass={'install': dist.InstallAndUpdateDataDirectory}
141- )
142+ cmdclass={'install': dist.InstallAndUpdateDataDirectory},
143+ data_files=[
144+ ('share/accomplishments-daemon', ['data/daemon/validation-key.pub'])
145+ ],
146+)

Subscribers

People subscribed via source and target branches

to all changes: