Merge lp:~mterry/quickly/small-refactor into lp:quickly
- small-refactor
- Merge into trunk
Proposed by
Michael Terry
Status: | Needs review |
---|---|
Proposed branch: | lp:~mterry/quickly/small-refactor |
Merge into: | lp:quickly |
Diff against target: |
753 lines (+207/-192) 14 files modified
data/templates/ubuntu-application/configure.py (+12/-15) data/templates/ubuntu-application/internal/bzrutils.py (+0/-37) data/templates/ubuntu-application/package.py (+2/-1) data/templates/ubuntu-application/release.py (+16/-17) data/templates/ubuntu-application/share.py (+5/-4) data/templates/ubuntu-application/submitubuntu.py (+16/-17) data/templates/ubuntu-application/test/apportutils.py (+7/-7) data/templates/ubuntu-application/upgrade.py (+3/-4) quickly/lp/__init__.py (+18/-0) quickly/lp/access.py (+3/-84) quickly/lp/bzr.py (+20/-1) quickly/lp/project.py (+82/-0) quickly/ubuntu/__init__.py (+18/-0) quickly/ubuntu/packaging.py (+5/-5) |
To merge this branch: | bzr merge lp:~mterry/quickly/small-refactor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Quickly Developers | Pending | ||
Review via email: mp+44606@code.launchpad.net |
Commit message
Description of the change
This is a bit of a refactor to pull some code from ubuntu-
This started based on the quickly-talk thread about how best to enable non-ubuntu templates. This doesn't directly aid that goal, as most of the stuff pulled out is for LP or Ubuntu integration. But it is a proof of concept.
After this is discussed/approved, we can perhaps pull out some of the python code to be more generic too.
To post a comment you must log in.
Unmerged revisions
- 581. By Michael Terry
-
move packaging and apport modules to a new quickly.ubuntu module
- 580. By Michael Terry
-
create and use quickly.lp
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'data/templates/ubuntu-application/configure.py' | |||
2 | --- data/templates/ubuntu-application/configure.py 2010-10-18 18:39:04 +0000 | |||
3 | +++ data/templates/ubuntu-application/configure.py 2010-12-23 18:15:10 +0000 | |||
4 | @@ -20,13 +20,10 @@ | |||
5 | 20 | import sys | 20 | import sys |
6 | 21 | import subprocess | 21 | import subprocess |
7 | 22 | 22 | ||
12 | 23 | import internal.apportutils | 23 | from internal import quicklyutils |
9 | 24 | |||
10 | 25 | from internal import quicklyutils, packaging | ||
11 | 26 | from internal import bzrutils | ||
13 | 27 | from quickly import configurationhandler, templatetools | 24 | from quickly import configurationhandler, templatetools |
16 | 28 | from quickly import launchpadaccess | 25 | from quickly.ubuntu import apport, packaging |
17 | 29 | 26 | import quickly.lp as lp | |
18 | 30 | 27 | ||
19 | 31 | import gettext | 28 | import gettext |
20 | 32 | from gettext import gettext as _ | 29 | from gettext import gettext as _ |
21 | @@ -73,8 +70,8 @@ | |||
22 | 73 | if argv[1] == "lp-project": | 70 | if argv[1] == "lp-project": |
23 | 74 | # connect to LP | 71 | # connect to LP |
24 | 75 | try: | 72 | try: |
27 | 76 | launchpad = launchpadaccess.initialize_lpi() | 73 | launchpad = lp.access.initialize_lpi() |
28 | 77 | except launchpadaccess.launchpad_connection_error, e: | 74 | except lp.access.launchpad_connection_error, e: |
29 | 78 | print(e) | 75 | print(e) |
30 | 79 | sys.exit(1) | 76 | sys.exit(1) |
31 | 80 | 77 | ||
32 | @@ -90,13 +87,13 @@ | |||
33 | 90 | previous_lp_project_name = configurationhandler.project_config.get('lp_id', None) | 87 | previous_lp_project_name = configurationhandler.project_config.get('lp_id', None) |
34 | 91 | quickly_project_name = configurationhandler.project_config.get('project', None) | 88 | quickly_project_name = configurationhandler.project_config.get('project', None) |
35 | 92 | try: | 89 | try: |
39 | 93 | project = launchpadaccess.link_project(launchpad, "Change your launchpad project:", project_name) | 90 | project = lp.project.link_project(launchpad, "Change your launchpad project:", project_name) |
40 | 94 | internal.apportutils.update_apport(quickly_project_name, previous_lp_project_name, project.name) | 91 | apport.update_apport(quickly_project_name, previous_lp_project_name, project.name) |
41 | 95 | except launchpadaccess.launchpad_project_error, e: | 92 | except lp.access.launchpad_project_error, e: |
42 | 96 | print(e) | 93 | print(e) |
43 | 97 | sys.exit(1) | 94 | sys.exit(1) |
44 | 98 | # get the project now and save the url into setup.py | 95 | # get the project now and save the url into setup.py |
46 | 99 | project_url = launchpadaccess.launchpad_url + '/' + project.name | 96 | project_url = lp.access.launchpad_url + '/' + project.name |
47 | 100 | quicklyutils.set_setup_value('url', project_url) | 97 | quicklyutils.set_setup_value('url', project_url) |
48 | 101 | about_dialog_file_name = quicklyutils.get_about_file_name() | 98 | about_dialog_file_name = quicklyutils.get_about_file_name() |
49 | 102 | if about_dialog_file_name: | 99 | if about_dialog_file_name: |
50 | @@ -112,8 +109,8 @@ | |||
51 | 112 | 109 | ||
52 | 113 | # connect to LP | 110 | # connect to LP |
53 | 114 | try: | 111 | try: |
56 | 115 | launchpad = launchpadaccess.initialize_lpi() | 112 | launchpad = lp.access.initialize_lpi() |
57 | 116 | except launchpadaccess.launchpad_connection_error, e: | 113 | except lp.access.launchpad_connection_error, e: |
58 | 117 | print(e) | 114 | print(e) |
59 | 118 | sys.exit(1) | 115 | sys.exit(1) |
60 | 119 | 116 | ||
61 | @@ -147,7 +144,7 @@ | |||
62 | 147 | if len(argv) != 3: | 144 | if len(argv) != 3: |
63 | 148 | templatetools.print_usage(options['bzr']) | 145 | templatetools.print_usage(options['bzr']) |
64 | 149 | sys.exit(4) | 146 | sys.exit(4) |
66 | 150 | bzrutils.set_bzrbranch(argv[2]) | 147 | lp.bzr.set_bzrbranch(argv[2]) |
67 | 151 | configurationhandler.saveConfig() | 148 | configurationhandler.saveConfig() |
68 | 152 | 149 | ||
69 | 153 | # add additional dependencies | 150 | # add additional dependencies |
70 | 154 | 151 | ||
71 | === removed file 'data/templates/ubuntu-application/internal/bzrutils.py' | |||
72 | --- data/templates/ubuntu-application/internal/bzrutils.py 2010-08-13 15:04:05 +0000 | |||
73 | +++ data/templates/ubuntu-application/internal/bzrutils.py 1970-01-01 00:00:00 +0000 | |||
74 | @@ -1,37 +0,0 @@ | |||
75 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
76 | 2 | # Copyright 2010 Didier Roche | ||
77 | 3 | # | ||
78 | 4 | # This file is part of Quickly ubuntu-application template | ||
79 | 5 | # | ||
80 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
81 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
82 | 8 | #by the Free Software Foundation. | ||
83 | 9 | |||
84 | 10 | #This program is distributed in the hope that it will be useful, but | ||
85 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
86 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
87 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
88 | 14 | |||
89 | 15 | #You should have received a copy of the GNU General Public License along | ||
90 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
91 | 17 | |||
92 | 18 | from quickly import configurationhandler | ||
93 | 19 | |||
94 | 20 | def set_bzrbranch(bzr_branch): | ||
95 | 21 | '''set default bzr branch from where to pull and push''' | ||
96 | 22 | |||
97 | 23 | if not configurationhandler.project_config: | ||
98 | 24 | configurationhandler.loadConfig() | ||
99 | 25 | configurationhandler.project_config['bzrbranch'] = bzr_branch | ||
100 | 26 | |||
101 | 27 | def get_bzrbranch(): | ||
102 | 28 | '''get default bzr branch from where to pull and push''' | ||
103 | 29 | |||
104 | 30 | if not configurationhandler.project_config: | ||
105 | 31 | configurationhandler.loadConfig() | ||
106 | 32 | |||
107 | 33 | try: | ||
108 | 34 | bzr_branch = configurationhandler.project_config['bzrbranch'] | ||
109 | 35 | except KeyError: | ||
110 | 36 | bzr_branch = None | ||
111 | 37 | return bzr_branch | ||
112 | 38 | 0 | ||
113 | === modified file 'data/templates/ubuntu-application/package.py' | |||
114 | --- data/templates/ubuntu-application/package.py 2010-10-15 20:26:19 +0000 | |||
115 | +++ data/templates/ubuntu-application/package.py 2010-12-23 18:15:10 +0000 | |||
116 | @@ -23,8 +23,9 @@ | |||
117 | 23 | from gettext import gettext as _ | 23 | from gettext import gettext as _ |
118 | 24 | gettext.textdomain('quickly') | 24 | gettext.textdomain('quickly') |
119 | 25 | 25 | ||
121 | 26 | from internal import quicklyutils, packaging | 26 | from internal import quicklyutils |
122 | 27 | from quickly import templatetools, configurationhandler | 27 | from quickly import templatetools, configurationhandler |
123 | 28 | from quickly.ubuntu import packaging | ||
124 | 28 | 29 | ||
125 | 29 | 30 | ||
126 | 30 | def usage(): | 31 | def usage(): |
127 | 31 | 32 | ||
128 | === modified file 'data/templates/ubuntu-application/release.py' | |||
129 | --- data/templates/ubuntu-application/release.py 2010-10-18 18:39:04 +0000 | |||
130 | +++ data/templates/ubuntu-application/release.py 2010-12-23 18:15:10 +0000 | |||
131 | @@ -21,15 +21,14 @@ | |||
132 | 21 | import subprocess | 21 | import subprocess |
133 | 22 | import webbrowser | 22 | import webbrowser |
134 | 23 | 23 | ||
137 | 24 | from internal import quicklyutils, packaging, launchpad_helper | 24 | from internal import quicklyutils |
136 | 25 | from internal import bzrutils | ||
138 | 26 | from quickly import templatetools, configurationhandler, commands | 25 | from quickly import templatetools, configurationhandler, commands |
139 | 26 | from quickly.ubuntu import packaging | ||
140 | 27 | import quickly.lp as lp | ||
141 | 27 | import license | 28 | import license |
142 | 28 | 29 | ||
143 | 29 | import logging | 30 | import logging |
144 | 30 | 31 | ||
145 | 31 | from quickly import launchpadaccess | ||
146 | 32 | |||
147 | 33 | import gettext | 32 | import gettext |
148 | 34 | from gettext import gettext as _ | 33 | from gettext import gettext as _ |
149 | 35 | gettext.textdomain('quickly') | 34 | gettext.textdomain('quickly') |
150 | @@ -113,8 +112,8 @@ | |||
151 | 113 | 112 | ||
152 | 114 | # connect to LP | 113 | # connect to LP |
153 | 115 | try: | 114 | try: |
156 | 116 | launchpad = launchpadaccess.initialize_lpi() | 115 | launchpad = lp.access.initialize_lpi() |
157 | 117 | except launchpadaccess.launchpad_connection_error, e: | 116 | except lp.access.launchpad_connection_error, e: |
158 | 118 | print(e) | 117 | print(e) |
159 | 119 | sys.exit(1) | 118 | sys.exit(1) |
160 | 120 | 119 | ||
161 | @@ -127,11 +126,11 @@ | |||
162 | 127 | 126 | ||
163 | 128 | # get the project now and save the url into setup.py | 127 | # get the project now and save the url into setup.py |
164 | 129 | try: | 128 | try: |
167 | 130 | project = launchpadaccess.get_project(launchpad) | 129 | project = lp.project.get_project(launchpad) |
168 | 131 | except launchpadaccess.launchpad_project_error, e: | 130 | except lp.access.launchpad_project_error, e: |
169 | 132 | print(e) | 131 | print(e) |
170 | 133 | sys.exit(1) | 132 | sys.exit(1) |
172 | 134 | project_url = launchpadaccess.launchpad_url + '/' + project.name | 133 | project_url = lp.access.launchpad_url + '/' + project.name |
173 | 135 | quicklyutils.set_setup_value('url', project_url) | 134 | quicklyutils.set_setup_value('url', project_url) |
174 | 136 | about_dialog_file_name = quicklyutils.get_about_file_name() | 135 | about_dialog_file_name = quicklyutils.get_about_file_name() |
175 | 137 | if about_dialog_file_name: | 136 | if about_dialog_file_name: |
176 | @@ -234,14 +233,14 @@ | |||
177 | 234 | sys.exit(1) | 233 | sys.exit(1) |
178 | 235 | 234 | ||
179 | 236 | 235 | ||
181 | 237 | if (launchpadaccess.lp_server == "staging"): | 236 | if (lp.access.lp_server == "staging"): |
182 | 238 | bzr_staging = "//staging/" | 237 | bzr_staging = "//staging/" |
183 | 239 | else: | 238 | else: |
184 | 240 | bzr_staging = "" | 239 | bzr_staging = "" |
185 | 241 | 240 | ||
186 | 242 | custom_location_in_info = None | 241 | custom_location_in_info = None |
187 | 243 | branch_location = [] | 242 | branch_location = [] |
189 | 244 | custom_location = bzrutils.get_bzrbranch() | 243 | custom_location = lp.bzr.get_bzrbranch() |
190 | 245 | if custom_location: | 244 | if custom_location: |
191 | 246 | branch_location = [custom_location] | 245 | branch_location = [custom_location] |
192 | 247 | custom_location_in_info = custom_location.replace('lp:', '') | 246 | custom_location_in_info = custom_location.replace('lp:', '') |
193 | @@ -282,14 +281,14 @@ | |||
194 | 282 | sys.exit(return_code) | 281 | sys.exit(return_code) |
195 | 283 | 282 | ||
196 | 284 | #create new release_date | 283 | #create new release_date |
200 | 285 | launchpad_helper.push_tarball_to_launchpad(project, release_version, | 284 | lp.project.push_tarball_to_launchpad(project, release_version, |
201 | 286 | "../%s_%s.tar.gz" % (project_name, | 285 | "../%s_%s.tar.gz" % (project_name, |
202 | 287 | release_version), changelog) | 286 | release_version), changelog) |
203 | 288 | 287 | ||
204 | 289 | print _("%s %s released and building on Launchpad. Wait for half an hour and have look at %s.") % (project_name, release_version, ppa_url) | 288 | print _("%s %s released and building on Launchpad. Wait for half an hour and have look at %s.") % (project_name, release_version, ppa_url) |
205 | 290 | 289 | ||
206 | 291 | # as launchpad-open doesn't support staging server, put an url | 290 | # as launchpad-open doesn't support staging server, put an url |
209 | 292 | if launchpadaccess.lp_server == "staging": | 291 | if lp.access.lp_server == "staging": |
210 | 293 | webbrowser.open(launchpadaccess.LAUNCHPAD_CODE_STAGING_URL + '/' + project.name) | 292 | webbrowser.open(lp.access.LAUNCHPAD_CODE_STAGING_URL + '/' + project.name) |
211 | 294 | else: | 293 | else: |
213 | 295 | webbrowser.open(launchpadaccess.LAUNCHPAD_URL + '/' + project.name) | 294 | webbrowser.open(lp.access.LAUNCHPAD_URL + '/' + project.name) |
214 | 296 | 295 | ||
215 | === modified file 'data/templates/ubuntu-application/share.py' | |||
216 | --- data/templates/ubuntu-application/share.py 2010-10-18 18:39:04 +0000 | |||
217 | +++ data/templates/ubuntu-application/share.py 2010-12-23 18:15:10 +0000 | |||
218 | @@ -28,8 +28,9 @@ | |||
219 | 28 | gettext.textdomain('quickly') | 28 | gettext.textdomain('quickly') |
220 | 29 | 29 | ||
221 | 30 | from quickly import configurationhandler | 30 | from quickly import configurationhandler |
224 | 31 | from internal import quicklyutils, packaging | 31 | from internal import quicklyutils |
225 | 32 | from quickly import launchpadaccess | 32 | from quickly.ubuntu import packaging |
226 | 33 | import quickly.lp as lp | ||
227 | 33 | 34 | ||
228 | 34 | launchpad = None | 35 | launchpad = None |
229 | 35 | ppa_name = None | 36 | ppa_name = None |
230 | @@ -98,8 +99,8 @@ | |||
231 | 98 | 99 | ||
232 | 99 | # connect to LP | 100 | # connect to LP |
233 | 100 | try: | 101 | try: |
236 | 101 | launchpad = launchpadaccess.initialize_lpi() | 102 | launchpad = lp.access.initialize_lpi() |
237 | 102 | except launchpadaccess.launchpad_connection_error, e: | 103 | except lp.access.launchpad_connection_error, e: |
238 | 103 | print(e) | 104 | print(e) |
239 | 104 | sys.exit(1) | 105 | sys.exit(1) |
240 | 105 | 106 | ||
241 | 106 | 107 | ||
242 | === modified file 'data/templates/ubuntu-application/submitubuntu.py' | |||
243 | --- data/templates/ubuntu-application/submitubuntu.py 2010-11-11 14:19:38 +0000 | |||
244 | +++ data/templates/ubuntu-application/submitubuntu.py 2010-12-23 18:15:10 +0000 | |||
245 | @@ -21,15 +21,14 @@ | |||
246 | 21 | import subprocess | 21 | import subprocess |
247 | 22 | import webbrowser | 22 | import webbrowser |
248 | 23 | 23 | ||
251 | 24 | from internal import quicklyutils, packaging, launchpad_helper | 24 | from internal import quicklyutils |
250 | 25 | from internal import bzrutils | ||
252 | 26 | from quickly import templatetools, configurationhandler, commands | 25 | from quickly import templatetools, configurationhandler, commands |
253 | 26 | from quickly.ubuntu import packaging | ||
254 | 27 | import quickly.lp as lp | ||
255 | 27 | import license | 28 | import license |
256 | 28 | 29 | ||
257 | 29 | import logging | 30 | import logging |
258 | 30 | 31 | ||
259 | 31 | from quickly import launchpadaccess | ||
260 | 32 | |||
261 | 33 | import gettext | 32 | import gettext |
262 | 34 | from gettext import gettext as _ | 33 | from gettext import gettext as _ |
263 | 35 | gettext.textdomain('quickly') | 34 | gettext.textdomain('quickly') |
264 | @@ -114,8 +113,8 @@ | |||
265 | 114 | 113 | ||
266 | 115 | # connect to LP | 114 | # connect to LP |
267 | 116 | try: | 115 | try: |
270 | 117 | launchpad = launchpadaccess.initialize_lpi() | 116 | launchpad = lp.access.initialize_lpi() |
271 | 118 | except launchpadaccess.launchpad_connection_error, e: | 117 | except lp.access.launchpad_connection_error, e: |
272 | 119 | print(e) | 118 | print(e) |
273 | 120 | sys.exit(1) | 119 | sys.exit(1) |
274 | 121 | 120 | ||
275 | @@ -128,11 +127,11 @@ | |||
276 | 128 | 127 | ||
277 | 129 | # get the project now and save the url into setup.py | 128 | # get the project now and save the url into setup.py |
278 | 130 | try: | 129 | try: |
281 | 131 | project = launchpadaccess.get_project(launchpad) | 130 | project = lp.project.get_project(launchpad) |
282 | 132 | except launchpadaccess.launchpad_project_error, e: | 131 | except lp.access.launchpad_project_error, e: |
283 | 133 | print(e) | 132 | print(e) |
284 | 134 | sys.exit(1) | 133 | sys.exit(1) |
286 | 135 | project_url = launchpadaccess.launchpad_url + '/' + project.name | 134 | project_url = lp.access.launchpad_url + '/' + project.name |
287 | 136 | quicklyutils.set_setup_value('url', project_url) | 135 | quicklyutils.set_setup_value('url', project_url) |
288 | 137 | about_dialog_file_name = quicklyutils.get_about_file_name() | 136 | about_dialog_file_name = quicklyutils.get_about_file_name() |
289 | 138 | if about_dialog_file_name: | 137 | if about_dialog_file_name: |
290 | @@ -235,14 +234,14 @@ | |||
291 | 235 | sys.exit(1) | 234 | sys.exit(1) |
292 | 236 | 235 | ||
293 | 237 | 236 | ||
295 | 238 | if (launchpadaccess.lp_server == "staging"): | 237 | if (lp.access.lp_server == "staging"): |
296 | 239 | bzr_staging = "//staging/" | 238 | bzr_staging = "//staging/" |
297 | 240 | else: | 239 | else: |
298 | 241 | bzr_staging = "" | 240 | bzr_staging = "" |
299 | 242 | 241 | ||
300 | 243 | custom_location_in_info = None | 242 | custom_location_in_info = None |
301 | 244 | branch_location = [] | 243 | branch_location = [] |
303 | 245 | custom_location = bzrutils.get_bzrbranch() | 244 | custom_location = lp.bzr.get_bzrbranch() |
304 | 246 | if custom_location: | 245 | if custom_location: |
305 | 247 | branch_location = [custom_location] | 246 | branch_location = [custom_location] |
306 | 248 | custom_location_in_info = custom_location.replace('lp:', '') | 247 | custom_location_in_info = custom_location.replace('lp:', '') |
307 | @@ -283,15 +282,15 @@ | |||
308 | 283 | sys.exit(return_code) | 282 | sys.exit(return_code) |
309 | 284 | 283 | ||
310 | 285 | #create new release_date | 284 | #create new release_date |
314 | 286 | launchpad_helper.push_tarball_to_launchpad(project, release_version, | 285 | lp.project.push_tarball_to_launchpad(project, release_version, |
315 | 287 | "../%s_%s.tar.gz" % (project_name, | 286 | "../%s_%s.tar.gz" % (project_name, |
316 | 288 | release_version), changelog) | 287 | release_version), changelog) |
317 | 289 | 288 | ||
318 | 290 | print _("%s %s released and submitted to ubuntu. Wait for half an hour and have look at %s.") % (project_name, release_version, ppa_url) | 289 | print _("%s %s released and submitted to ubuntu. Wait for half an hour and have look at %s.") % (project_name, release_version, ppa_url) |
319 | 291 | print _("Then your application will be reviewed by the application review board.") | 290 | print _("Then your application will be reviewed by the application review board.") |
320 | 292 | 291 | ||
321 | 293 | # as launchpad-open doesn't support staging server, put an url | 292 | # as launchpad-open doesn't support staging server, put an url |
324 | 294 | if launchpadaccess.lp_server == "staging": | 293 | if lp.access.lp_server == "staging": |
325 | 295 | webbrowser.open(launchpadaccess.LAUNCHPAD_CODE_STAGING_URL + '/' + project.name) | 294 | webbrowser.open(lp.access.LAUNCHPAD_CODE_STAGING_URL + '/' + project.name) |
326 | 296 | else: | 295 | else: |
328 | 297 | webbrowser.open(launchpadaccess.LAUNCHPAD_URL + '/' + project.name) | 296 | webbrowser.open(lp.access.LAUNCHPAD_URL + '/' + project.name) |
329 | 298 | 297 | ||
330 | === modified file 'data/templates/ubuntu-application/test/apportutils.py' | |||
331 | --- data/templates/ubuntu-application/test/apportutils.py 2010-12-20 15:44:44 +0000 | |||
332 | +++ data/templates/ubuntu-application/test/apportutils.py 2010-12-23 18:15:10 +0000 | |||
333 | @@ -14,9 +14,9 @@ | |||
334 | 14 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),".."))) | 14 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),".."))) |
335 | 15 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),"..","..","..",".."))) | 15 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),"..","..","..",".."))) |
336 | 16 | 16 | ||
338 | 17 | from internal import apportutils | 17 | from quickly.ubuntu import apport |
339 | 18 | 18 | ||
341 | 19 | class TestApportUtils(unittest.TestCase): | 19 | class TestApport(unittest.TestCase): |
342 | 20 | def test_lpi_existing(self): | 20 | def test_lpi_existing(self): |
343 | 21 | lines = """#!/usr/bin/python | 21 | lines = """#!/usr/bin/python |
344 | 22 | import sys | 22 | import sys |
345 | @@ -56,7 +56,7 @@ | |||
346 | 56 | response = about.run() | 56 | response = about.run() |
347 | 57 | about.destroy() | 57 | about.destroy() |
348 | 58 | """.splitlines() | 58 | """.splitlines() |
350 | 59 | self.failIf(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) | 59 | self.failIf(apport.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) |
351 | 60 | 60 | ||
352 | 61 | def test_partial_lpi_import_only(self): | 61 | def test_partial_lpi_import_only(self): |
353 | 62 | lines = """#!/usr/bin/python | 62 | lines = """#!/usr/bin/python |
354 | @@ -91,7 +91,7 @@ | |||
355 | 91 | response = about.run() | 91 | response = about.run() |
356 | 92 | about.destroy() | 92 | about.destroy() |
357 | 93 | """.splitlines() | 93 | """.splitlines() |
359 | 94 | self.failIf(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) | 94 | self.failIf(apport.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) |
360 | 95 | 95 | ||
361 | 96 | def test_no_lpi(self): | 96 | def test_no_lpi(self): |
362 | 97 | lines = """#!/usr/bin/python | 97 | lines = """#!/usr/bin/python |
363 | @@ -153,9 +153,9 @@ | |||
364 | 153 | response = about.run() | 153 | response = about.run() |
365 | 154 | about.destroy() | 154 | about.destroy() |
366 | 155 | """ | 155 | """ |
368 | 156 | # print "".join(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) | 156 | # print "".join(apport.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")) |
369 | 157 | # print "".join(expected.splitlines(True)) | 157 | # print "".join(expected.splitlines(True)) |
371 | 158 | self.assertEqual("".join(expected.splitlines(True)).strip(), "".join(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")).strip()) | 158 | self.assertEqual("".join(expected.splitlines(True)).strip(), "".join(apport.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")).strip()) |
372 | 159 | 159 | ||
373 | 160 | def test_find_about_menu(self): | 160 | def test_find_about_menu(self): |
374 | 161 | xml_tree = etree.parse(StringIO.StringIO("""<?xml version="1.0"?> | 161 | xml_tree = etree.parse(StringIO.StringIO("""<?xml version="1.0"?> |
375 | @@ -207,6 +207,6 @@ | |||
376 | 207 | </child> | 207 | </child> |
377 | 208 | </object> | 208 | </object> |
378 | 209 | </interface>""")) | 209 | </interface>""")) |
380 | 210 | self.assertEqual("testHelpMenu", apportutils.find_about_menu(xml_tree)) | 210 | self.assertEqual("testHelpMenu", apport.find_about_menu(xml_tree)) |
381 | 211 | 211 | ||
382 | 212 | unittest.main() | 212 | unittest.main() |
383 | 213 | 213 | ||
384 | === modified file 'data/templates/ubuntu-application/upgrade.py' | |||
385 | --- data/templates/ubuntu-application/upgrade.py 2010-12-07 14:14:08 +0000 | |||
386 | +++ data/templates/ubuntu-application/upgrade.py 2010-12-23 18:15:10 +0000 | |||
387 | @@ -21,10 +21,9 @@ | |||
388 | 21 | import subprocess | 21 | import subprocess |
389 | 22 | import sys | 22 | import sys |
390 | 23 | 23 | ||
391 | 24 | import internal.apportutils | ||
392 | 25 | |||
393 | 26 | from internal import quicklyutils | 24 | from internal import quicklyutils |
394 | 27 | from quickly import configurationhandler, templatetools | 25 | from quickly import configurationhandler, templatetools |
395 | 26 | from quickly.ubuntu import apport | ||
396 | 28 | 27 | ||
397 | 29 | import gettext | 28 | import gettext |
398 | 30 | from gettext import gettext as _ | 29 | from gettext import gettext as _ |
399 | @@ -141,10 +140,10 @@ | |||
400 | 141 | pass | 140 | pass |
401 | 142 | 141 | ||
402 | 143 | # add apport hooks if launchpad application is configured | 142 | # add apport hooks if launchpad application is configured |
404 | 144 | internal.apportutils.insert_lpi_if_required(project_name) | 143 | apport.insert_lpi_if_required(project_name) |
405 | 145 | lp_project_name = configurationhandler.project_config.get('lp_id', None) | 144 | lp_project_name = configurationhandler.project_config.get('lp_id', None) |
406 | 146 | if lp_project_name is not None: | 145 | if lp_project_name is not None: |
408 | 147 | internal.apportutils.update_apport(project_name, lp_project_name, lp_project_name) | 146 | apport.update_apport(project_name, lp_project_name, lp_project_name) |
409 | 148 | 147 | ||
410 | 149 | # new dialog file needs helpers.py | 148 | # new dialog file needs helpers.py |
411 | 150 | if not os.path.isfile('%s/helpers.py' % python_name): | 149 | if not os.path.isfile('%s/helpers.py' % python_name): |
412 | 151 | 150 | ||
413 | === added directory 'quickly/lp' | |||
414 | === added file 'quickly/lp/__init__.py' | |||
415 | --- quickly/lp/__init__.py 1970-01-01 00:00:00 +0000 | |||
416 | +++ quickly/lp/__init__.py 2010-12-23 18:15:10 +0000 | |||
417 | @@ -0,0 +1,18 @@ | |||
418 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
419 | 2 | # Copyright 2010 Canonical Ltd | ||
420 | 3 | # | ||
421 | 4 | # This file is part of Quickly | ||
422 | 5 | # | ||
423 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
424 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
425 | 8 | #by the Free Software Foundation. | ||
426 | 9 | # | ||
427 | 10 | #This program is distributed in the hope that it will be useful, but | ||
428 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
429 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
430 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
431 | 14 | # | ||
432 | 15 | #You should have received a copy of the GNU General Public License along | ||
433 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
434 | 17 | |||
435 | 18 | import access, bzr, project | ||
436 | 0 | 19 | ||
437 | === renamed file 'quickly/launchpadaccess.py' => 'quickly/lp/access.py' | |||
438 | --- quickly/launchpadaccess.py 2010-10-13 19:07:55 +0000 | |||
439 | +++ quickly/lp/access.py 2010-12-23 18:15:10 +0000 | |||
440 | @@ -24,7 +24,7 @@ | |||
441 | 24 | LAUNCHPAD_STAGING_URL = "https://staging.launchpad.net" | 24 | LAUNCHPAD_STAGING_URL = "https://staging.launchpad.net" |
442 | 25 | LAUNCHPAD_CODE_STAGING_URL = "https://code.staging.launchpad.net" | 25 | LAUNCHPAD_CODE_STAGING_URL = "https://code.staging.launchpad.net" |
443 | 26 | 26 | ||
445 | 27 | # TODO: see how to export this error on import launchpadaccess (in init.py ?) | 27 | # TODO: see how to export this error on import quickly.lp.access (in init.py ?) |
446 | 28 | class launchpad_connection_error(Exception): | 28 | class launchpad_connection_error(Exception): |
447 | 29 | pass | 29 | pass |
448 | 30 | class launchpad_project_error(Exception): | 30 | class launchpad_project_error(Exception): |
449 | @@ -40,7 +40,7 @@ | |||
450 | 40 | sys.exit(1) | 40 | sys.exit(1) |
451 | 41 | 41 | ||
452 | 42 | 42 | ||
454 | 43 | from quickly import bzrbinding | 43 | from quickly.lp import bzr |
455 | 44 | from quickly import configurationhandler | 44 | from quickly import configurationhandler |
456 | 45 | 45 | ||
457 | 46 | import gettext | 46 | import gettext |
458 | @@ -118,7 +118,7 @@ | |||
459 | 118 | 118 | ||
460 | 119 | # try to setup bzr | 119 | # try to setup bzr |
461 | 120 | me = launchpad.me | 120 | me = launchpad.me |
463 | 121 | (return_code, suggestion) = bzrbinding.bzr_set_login(me.display_name, me.preferred_email_address.email, me.name) | 121 | (return_code, suggestion) = bzr.bzr_set_login(me.display_name, me.preferred_email_address.email, me.name) |
464 | 122 | 122 | ||
465 | 123 | if interactive: | 123 | if interactive: |
466 | 124 | if launchpad is None or return_code != 0: | 124 | if launchpad is None or return_code != 0: |
467 | @@ -130,84 +130,3 @@ | |||
468 | 130 | 130 | ||
469 | 131 | return launchpad | 131 | return launchpad |
470 | 132 | 132 | ||
471 | 133 | |||
472 | 134 | def link_project(launchpad, question, lp_project_name=None): | ||
473 | 135 | ''' Link to launchpad project, erasing previous one if already set | ||
474 | 136 | |||
475 | 137 | |||
476 | 138 | :return project object''' | ||
477 | 139 | |||
478 | 140 | # if config not already loaded | ||
479 | 141 | if not configurationhandler.project_config: | ||
480 | 142 | configurationhandler.loadConfig() | ||
481 | 143 | |||
482 | 144 | if not lp_project_name: | ||
483 | 145 | choice = "0" | ||
484 | 146 | while choice == "0": | ||
485 | 147 | |||
486 | 148 | lp_id = raw_input("%s, leave blank to abort.\nLaunchpad project name: " % question) | ||
487 | 149 | if lp_id == "": | ||
488 | 150 | raise launchpad_project_error(_("No launchpad project given, aborting.")) | ||
489 | 151 | |||
490 | 152 | prospective_projects = launchpad.projects.search(text=lp_id) | ||
491 | 153 | project_number = 1 | ||
492 | 154 | project_names = [] | ||
493 | 155 | for project in prospective_projects: | ||
494 | 156 | print (_('''---------------- [%s] ---------------- | ||
495 | 157 | %s | ||
496 | 158 | -------------------------------------- | ||
497 | 159 | Project name: %s | ||
498 | 160 | Launchpad url: %s/%s | ||
499 | 161 | %s | ||
500 | 162 | ''') % (project_number, project.title, project.display_name, launchpad_url, project.name, project.summary)) | ||
501 | 163 | project_names.append(project.name) | ||
502 | 164 | project_number += 1 | ||
503 | 165 | |||
504 | 166 | if not list(prospective_projects): | ||
505 | 167 | message = _("No project found") | ||
506 | 168 | else: | ||
507 | 169 | message = _("Choose your project number") | ||
508 | 170 | choice = raw_input("%s, leave blank to abort, 0 for another search.\nYour choice: " % message) | ||
509 | 171 | |||
510 | 172 | try: | ||
511 | 173 | choice = int(choice) | ||
512 | 174 | if choice in range(1, project_number): | ||
513 | 175 | project = launchpad.projects[project_names[choice - 1]] | ||
514 | 176 | else: | ||
515 | 177 | raise ValueError | ||
516 | 178 | except ValueError: | ||
517 | 179 | raise launchpad_project_error(_("No right number given, aborting.")) | ||
518 | 180 | |||
519 | 181 | # we got a project name, check that it exists | ||
520 | 182 | else: | ||
521 | 183 | try: | ||
522 | 184 | project = launchpad.projects[lp_project_name] | ||
523 | 185 | except KeyError: | ||
524 | 186 | raise launchpad_project_error(_("Can't find %s project on Launchpad. You can try to find it interactively without providing a project name.") % lp_project_name) | ||
525 | 187 | |||
526 | 188 | configurationhandler.project_config['lp_id'] = project.name | ||
527 | 189 | configurationhandler.saveConfig() | ||
528 | 190 | |||
529 | 191 | return project | ||
530 | 192 | |||
531 | 193 | def get_project(launchpad): | ||
532 | 194 | ''' Get quickly project through launchpad. | ||
533 | 195 | |||
534 | 196 | :return project object | ||
535 | 197 | ''' | ||
536 | 198 | |||
537 | 199 | # if config not already loaded | ||
538 | 200 | if not configurationhandler.project_config: | ||
539 | 201 | configurationhandler.loadConfig() | ||
540 | 202 | |||
541 | 203 | # try to get project | ||
542 | 204 | try: | ||
543 | 205 | lp_id = configurationhandler.project_config['lp_id'] | ||
544 | 206 | project = launchpad.projects[lp_id] | ||
545 | 207 | |||
546 | 208 | # else, bind the project to LP | ||
547 | 209 | except KeyError: | ||
548 | 210 | project = link_project(launchpad, "No Launchpad project set") | ||
549 | 211 | |||
550 | 212 | return project | ||
551 | 213 | |||
552 | 214 | 133 | ||
553 | === renamed file 'quickly/bzrbinding.py' => 'quickly/lp/bzr.py' | |||
554 | --- quickly/bzrbinding.py 2010-09-28 12:53:04 +0000 | |||
555 | +++ quickly/lp/bzr.py 2010-12-23 18:15:10 +0000 | |||
556 | @@ -1,5 +1,5 @@ | |||
557 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
559 | 2 | # Copyright 2009 Didier Roche | 2 | # Copyright 2009,2010 Didier Roche |
560 | 3 | # | 3 | # |
561 | 4 | # This file is part of Quickly | 4 | # This file is part of Quickly |
562 | 5 | # | 5 | # |
563 | @@ -17,6 +17,7 @@ | |||
564 | 17 | 17 | ||
565 | 18 | import socket | 18 | import socket |
566 | 19 | import subprocess | 19 | import subprocess |
567 | 20 | from quickly import configurationhandler | ||
568 | 20 | 21 | ||
569 | 21 | def bzr_set_login(display_name, preferred_email_adress, launchpad_name=None): | 22 | def bzr_set_login(display_name, preferred_email_adress, launchpad_name=None): |
570 | 22 | ''' try to setup bzr whoami for commit and sshing and bzr launchpad_login if provided | 23 | ''' try to setup bzr whoami for commit and sshing and bzr launchpad_login if provided |
571 | @@ -52,3 +53,21 @@ | |||
572 | 52 | 53 | ||
573 | 53 | return (0, "") | 54 | return (0, "") |
574 | 54 | 55 | ||
575 | 56 | def set_bzrbranch(bzr_branch): | ||
576 | 57 | '''set default bzr branch from where to pull and push''' | ||
577 | 58 | |||
578 | 59 | if not configurationhandler.project_config: | ||
579 | 60 | configurationhandler.loadConfig() | ||
580 | 61 | configurationhandler.project_config['bzrbranch'] = bzr_branch | ||
581 | 62 | |||
582 | 63 | def get_bzrbranch(): | ||
583 | 64 | '''get default bzr branch from where to pull and push''' | ||
584 | 65 | |||
585 | 66 | if not configurationhandler.project_config: | ||
586 | 67 | configurationhandler.loadConfig() | ||
587 | 68 | |||
588 | 69 | try: | ||
589 | 70 | bzr_branch = configurationhandler.project_config['bzrbranch'] | ||
590 | 71 | except KeyError: | ||
591 | 72 | bzr_branch = None | ||
592 | 73 | return bzr_branch | ||
593 | 55 | 74 | ||
594 | === renamed file 'data/templates/ubuntu-application/internal/launchpad_helper.py' => 'quickly/lp/project.py' | |||
595 | --- data/templates/ubuntu-application/internal/launchpad_helper.py 2010-08-13 15:04:05 +0000 | |||
596 | +++ quickly/lp/project.py 2010-12-23 18:15:10 +0000 | |||
597 | @@ -22,10 +22,92 @@ | |||
598 | 22 | import sys | 22 | import sys |
599 | 23 | import subprocess | 23 | import subprocess |
600 | 24 | 24 | ||
601 | 25 | from quickly import configurationhandler | ||
602 | 26 | |||
603 | 25 | import gettext | 27 | import gettext |
604 | 26 | from gettext import gettext as _ | 28 | from gettext import gettext as _ |
605 | 27 | gettext.textdomain('quickly') | 29 | gettext.textdomain('quickly') |
606 | 28 | 30 | ||
607 | 31 | def link_project(launchpad, question, lp_project_name=None): | ||
608 | 32 | ''' Link to launchpad project, erasing previous one if already set | ||
609 | 33 | |||
610 | 34 | |||
611 | 35 | :return project object''' | ||
612 | 36 | |||
613 | 37 | # if config not already loaded | ||
614 | 38 | if not configurationhandler.project_config: | ||
615 | 39 | configurationhandler.loadConfig() | ||
616 | 40 | |||
617 | 41 | if not lp_project_name: | ||
618 | 42 | choice = "0" | ||
619 | 43 | while choice == "0": | ||
620 | 44 | |||
621 | 45 | lp_id = raw_input("%s, leave blank to abort.\nLaunchpad project name: " % question) | ||
622 | 46 | if lp_id == "": | ||
623 | 47 | raise launchpad_project_error(_("No launchpad project given, aborting.")) | ||
624 | 48 | |||
625 | 49 | prospective_projects = launchpad.projects.search(text=lp_id) | ||
626 | 50 | project_number = 1 | ||
627 | 51 | project_names = [] | ||
628 | 52 | for project in prospective_projects: | ||
629 | 53 | print (_('''---------------- [%s] ---------------- | ||
630 | 54 | %s | ||
631 | 55 | -------------------------------------- | ||
632 | 56 | Project name: %s | ||
633 | 57 | Launchpad url: %s/%s | ||
634 | 58 | %s | ||
635 | 59 | ''') % (project_number, project.title, project.display_name, launchpad_url, project.name, project.summary)) | ||
636 | 60 | project_names.append(project.name) | ||
637 | 61 | project_number += 1 | ||
638 | 62 | |||
639 | 63 | if not list(prospective_projects): | ||
640 | 64 | message = _("No project found") | ||
641 | 65 | else: | ||
642 | 66 | message = _("Choose your project number") | ||
643 | 67 | choice = raw_input("%s, leave blank to abort, 0 for another search.\nYour choice: " % message) | ||
644 | 68 | |||
645 | 69 | try: | ||
646 | 70 | choice = int(choice) | ||
647 | 71 | if choice in range(1, project_number): | ||
648 | 72 | project = launchpad.projects[project_names[choice - 1]] | ||
649 | 73 | else: | ||
650 | 74 | raise ValueError | ||
651 | 75 | except ValueError: | ||
652 | 76 | raise launchpad_project_error(_("No right number given, aborting.")) | ||
653 | 77 | |||
654 | 78 | # we got a project name, check that it exists | ||
655 | 79 | else: | ||
656 | 80 | try: | ||
657 | 81 | project = launchpad.projects[lp_project_name] | ||
658 | 82 | except KeyError: | ||
659 | 83 | raise launchpad_project_error(_("Can't find %s project on Launchpad. You can try to find it interactively without providing a project name.") % lp_project_name) | ||
660 | 84 | |||
661 | 85 | configurationhandler.project_config['lp_id'] = project.name | ||
662 | 86 | configurationhandler.saveConfig() | ||
663 | 87 | |||
664 | 88 | return project | ||
665 | 89 | |||
666 | 90 | def get_project(launchpad): | ||
667 | 91 | ''' Get quickly project through launchpad. | ||
668 | 92 | |||
669 | 93 | :return project object | ||
670 | 94 | ''' | ||
671 | 95 | |||
672 | 96 | # if config not already loaded | ||
673 | 97 | if not configurationhandler.project_config: | ||
674 | 98 | configurationhandler.loadConfig() | ||
675 | 99 | |||
676 | 100 | # try to get project | ||
677 | 101 | try: | ||
678 | 102 | lp_id = configurationhandler.project_config['lp_id'] | ||
679 | 103 | project = launchpad.projects[lp_id] | ||
680 | 104 | |||
681 | 105 | # else, bind the project to LP | ||
682 | 106 | except KeyError: | ||
683 | 107 | project = link_project(launchpad, "No Launchpad project set") | ||
684 | 108 | |||
685 | 109 | return project | ||
686 | 110 | |||
687 | 29 | #TODO: see if 0 release in the project | 111 | #TODO: see if 0 release in the project |
688 | 30 | 112 | ||
689 | 31 | def create_release(project, version): | 113 | def create_release(project, version): |
690 | 32 | 114 | ||
691 | === added directory 'quickly/ubuntu' | |||
692 | === added file 'quickly/ubuntu/__init__.py' | |||
693 | --- quickly/ubuntu/__init__.py 1970-01-01 00:00:00 +0000 | |||
694 | +++ quickly/ubuntu/__init__.py 2010-12-23 18:15:10 +0000 | |||
695 | @@ -0,0 +1,18 @@ | |||
696 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
697 | 2 | # Copyright 2010 Canonical Ltd | ||
698 | 3 | # | ||
699 | 4 | # This file is part of Quickly | ||
700 | 5 | # | ||
701 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
702 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
703 | 8 | #by the Free Software Foundation. | ||
704 | 9 | # | ||
705 | 10 | #This program is distributed in the hope that it will be useful, but | ||
706 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
707 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
708 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
709 | 14 | # | ||
710 | 15 | #You should have received a copy of the GNU General Public License along | ||
711 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
712 | 17 | |||
713 | 18 | import apport, packaging | ||
714 | 0 | 19 | ||
715 | === renamed file 'data/templates/ubuntu-application/internal/apportutils.py' => 'quickly/ubuntu/apport.py' | |||
716 | === renamed file 'data/templates/ubuntu-application/internal/packaging.py' => 'quickly/ubuntu/packaging.py' | |||
717 | --- data/templates/ubuntu-application/internal/packaging.py 2010-11-23 14:26:08 +0000 | |||
718 | +++ quickly/ubuntu/packaging.py 2010-12-23 18:15:10 +0000 | |||
719 | @@ -24,7 +24,7 @@ | |||
720 | 24 | 24 | ||
721 | 25 | 25 | ||
722 | 26 | from quickly import configurationhandler | 26 | from quickly import configurationhandler |
724 | 27 | from quickly import launchpadaccess | 27 | import quickly.lp as lp |
725 | 28 | from internal import quicklyutils | 28 | from internal import quicklyutils |
726 | 29 | from quickly import templatetools | 29 | from quickly import templatetools |
727 | 30 | 30 | ||
728 | @@ -229,8 +229,8 @@ | |||
729 | 229 | 229 | ||
730 | 230 | # connect to LP and get ppa to complete | 230 | # connect to LP and get ppa to complete |
731 | 231 | try: | 231 | try: |
734 | 232 | launchpad = launchpadaccess.initialize_lpi(False) | 232 | launchpad = lp.access.initialize_lpi(False) |
735 | 233 | except launchpadaccess.launchpad_connection_error: | 233 | except lp.access.launchpad_connection_error: |
736 | 234 | sys.exit(0) | 234 | sys.exit(0) |
737 | 235 | available_ppas = [] | 235 | available_ppas = [] |
738 | 236 | if launchpad: | 236 | if launchpad: |
739 | @@ -287,13 +287,13 @@ | |||
740 | 287 | (ppa_user, ppa_name) = get_ppa_parameters(launchpad, configurationhandler.project_config['ppa']) | 287 | (ppa_user, ppa_name) = get_ppa_parameters(launchpad, configurationhandler.project_config['ppa']) |
741 | 288 | except KeyError: | 288 | except KeyError: |
742 | 289 | ppa_user = launchpad.me | 289 | ppa_user = launchpad.me |
744 | 290 | if (launchpadaccess.lp_server == "staging"): | 290 | if (lp.access.lp_server == "staging"): |
745 | 291 | ppa_name = 'staging' | 291 | ppa_name = 'staging' |
746 | 292 | else: # default ppa | 292 | else: # default ppa |
747 | 293 | ppa_name = 'ppa' | 293 | ppa_name = 'ppa' |
748 | 294 | else: | 294 | else: |
749 | 295 | (ppa_user, ppa_name) = get_ppa_parameters(launchpad, ppa_name) | 295 | (ppa_user, ppa_name) = get_ppa_parameters(launchpad, ppa_name) |
751 | 296 | ppa_url = '%s/~%s/+archive/%s' % (launchpadaccess.LAUNCHPAD_URL, ppa_user.name, ppa_name) | 296 | ppa_url = '%s/~%s/+archive/%s' % (lp.access.LAUNCHPAD_URL, ppa_user.name, ppa_name) |
752 | 297 | dput_ppa_name = 'ppa:%s/%s' % (ppa_user.name, ppa_name) | 297 | dput_ppa_name = 'ppa:%s/%s' % (ppa_user.name, ppa_name) |
753 | 298 | return (ppa_user, ppa_name, dput_ppa_name, ppa_url.encode('UTF-8')) | 298 | return (ppa_user, ppa_name, dput_ppa_name, ppa_url.encode('UTF-8')) |
754 | 299 | 299 |