Merge lp:~mterry/quickly/yelp-depends into lp:quickly

Proposed by Michael Terry
Status: Merged
Merged at revision: 586
Proposed branch: lp:~mterry/quickly/yelp-depends
Merge into: lp:quickly
Diff against target: 40 lines (+15/-5)
1 file modified
data/templates/ubuntu-application/internal/packaging.py (+15/-5)
To merge this branch: bzr merge lp:~mterry/quickly/yelp-depends
Reviewer Review Type Date Requested Status
Tony Byrne Approve
Review via email: mp+44289@code.launchpad.net

Description of the change

Projects should depend on yelp, now that we have mallard help for them. This is Tony's depend-on-yelp patch [1] plus some logic to fix projects on upgrade.

[1] http://launchpadlibrarian.net/60964440/depend_yelp.patch

To post a comment you must log in.
Revision history for this message
Tony Byrne (tony-badwolf) wrote :

The upgrade logic is unhelpful. If you create an project with quickly version 0.6.1 then run it with quickly version 11.03.1 (yelp-depends), upgrade adds the yelp dependency. However the project does not call gnome-help. I suggest we do something like move the yelp depend logic from create and upgrade to package (obvious when you think about it) and have package check for the existence of a helpers.show_uri function before adding the dependency. I don't know whether release or share call package but they need consideration if they don't. From quickly-talk I think the consensus is to keep upgrade simple if we can.

********* begin test Makefile (use in empty directory and change WORK path)
WORK=/home/tony/projects/branches/yelp-depends
TRUNK = /home/tony/projects/trunk/quickly
TEMPLATE=ubuntu-application
DUT="test project"
PYTHON_NAME=test-project

all: version create

version:
 quickly --version

clean:
 rm -rf $(PYTHON_NAME)

create: clean
 quickly create $(TEMPLATE) $(DUT)

run:
 export PATH=$(WORK)/bin:$$PATH; cd $(PYTHON_NAME); quickly run -v

dot:
 cd $(PYTHON_NAME); cat .quickly

add:
 export PATH=$(WORK)/bin:$$PATH; cd $(PYTHON_NAME); quickly add help-guide index

*************** end test script

As a bonus it might be nice to have $quickly add help-guide and $quickly add help-topic inject the necessary functions into helpers and modify the project's help menu.

review: Needs Fixing
lp:~mterry/quickly/yelp-depends updated
580. By Michael Terry

undo previous commit and instead check for ghelp usage when packaging and insert yelp then

Revision history for this message
Michael Terry (mterry) wrote :

Good point. I've updated this to undo our previous code and instead add a check at packaging time (for any command that creates packages) to insert a yelp dependency if ghelp: urls are being used.

Revision history for this message
Tony Byrne (tony-badwolf) wrote :

Looks good, using "ghelp:" in the glade handlers is perfect for discovering the dependency. The previous commit does raise a point that needs addressing, probably in a tutorial or upgrade notes. When an old ubuntu-application project is worked on by the user in natty, (s)he gets a new command $quickly add help-topic "name" which adds the mallard file but not the code to access it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/templates/ubuntu-application/internal/packaging.py'
2--- data/templates/ubuntu-application/internal/packaging.py 2010-11-23 14:26:08 +0000
3+++ data/templates/ubuntu-application/internal/packaging.py 2011-01-04 19:11:04 +0000
4@@ -162,6 +162,15 @@
5 version = proc.communicate()[0]
6 return float(version)
7
8+def get_forced_dependencies():
9+ deps = []
10+
11+ # check for yelp usage
12+ if subprocess.call(["grep", "-rq", "['\"]ghelp:", "."]) == 0:
13+ deps.append("yelp")
14+
15+ return deps
16+
17 def updatepackaging(changelog=None, no_changelog=False, installopt=False):
18 """create or update a package using python-mkdebian.
19
20@@ -181,14 +190,15 @@
21 command.extend(["--changelog", message])
22 if not configurationhandler.project_config:
23 configurationhandler.loadConfig()
24+ dependencies = get_forced_dependencies()
25 try:
26- dependencies = [elem.strip() for elem
27- in configurationhandler.project_config['dependencies'].split(',')
28- if elem]
29- for dep in dependencies:
30- command.extend(["--dependency", dep])
31+ dependencies.extend([elem.strip() for elem
32+ in configurationhandler.project_config['dependencies'].split(',')
33+ if elem])
34 except KeyError:
35 pass
36+ for dep in dependencies:
37+ command.extend(["--dependency", dep])
38 try:
39 distribution = configurationhandler.project_config['target_distribution']
40 command.extend(["--distribution", distribution])

Subscribers

People subscribed via source and target branches