Merge lp:~robert-ancell/quickly/drop-lpi into lp:quickly

Proposed by Robert Ancell
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 668
Merged at revision: 684
Proposed branch: lp:~robert-ancell/quickly/drop-lpi
Merge into: lp:quickly
Diff against target: 541 lines (+0/-395)
6 files modified
data/templates/ubuntu-application/internal/apportutils.py (+0/-57)
data/templates/ubuntu-application/project_root/python_lib/Window.py (+0/-11)
data/templates/ubuntu-application/test/apport/TestProjectWindow.py.no_lpi (+0/-102)
data/templates/ubuntu-application/test/apport/apport.sh (+0/-84)
data/templates/ubuntu-application/test/apportutils.py (+0/-140)
data/templates/ubuntu-application/upgrade.py (+0/-1)
To merge this branch: bzr merge lp:~robert-ancell/quickly/drop-lpi
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Needs Fixing
Review via email: mp+105735@code.launchpad.net

Description of the change

Remove Launchpad integration. It will be removed in Quantal:
https://blueprints.launchpad.net/ubuntu/+spec/desktop-q-gnome-plans-review

Not sure if this branch does enough, and also the packaging needs to be updated to drop the dependency.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

that looks good. Nice work Robert!

I think you did all what is needed apart from giving an upgrade story.
Can you try to add an upgrade path to data/templates/ubuntu-application/upgrade.py to remove it (if the stenza is found) on project upgrade?
You should "just" need to remove bump the version of the template and remove the lpi lines if you find them anywhere on the project directory.

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

Didier, does this need to remove the code on upgrade? It's harmless if the module isn't present (ignores the exception).

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

@Michael: you are right, but that means that we will still install it if the application packaging was generated on a machine that have LPI, it will be pulled on the user's machine for nothing, wdyt?

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

Fair.

I have a branch I'm about to propose that will help with such upgrade.py issues (the branch will finally actually keep bin/, setup.py, and python_lib/ up to date with the latest versions automatically, so we don't have to keep managing upgrade.py ourselves for the quickly-owned code).

I'll base it off this branch because there is actually some overlapping changes in the apport test. So if the upgrade branch gets approval, this can land too, because it will get upgrade support automatically.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I'm approving this one then, please feel free to merge it altogether with your test branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/templates/ubuntu-application/internal/apportutils.py'
--- data/templates/ubuntu-application/internal/apportutils.py 2011-06-06 10:14:40 +0000
+++ data/templates/ubuntu-application/internal/apportutils.py 2012-05-14 22:57:18 +0000
@@ -28,19 +28,6 @@
2828
29from lxml import etree29from lxml import etree
3030
31LPI_init_menu_block = """
32 # Optional Launchpad integration
33 # This shouldn't crash if not found as it is simply used for bug reporting.
34 # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
35 # for more information about Launchpad integration.
36 try:
37 import LaunchpadIntegration
38 LaunchpadIntegration.add_items(self.ui.%(help_menu)s, 1, True, True)
39 LaunchpadIntegration.set_sourcepackagename('%(project_name)s')
40 except:
41 pass
42"""
43
44def update_apport(project_name, old_lp_project, new_lp_project):31def update_apport(project_name, old_lp_project, new_lp_project):
45 if not new_lp_project:32 if not new_lp_project:
46 return33 return
@@ -88,50 +75,6 @@
88 os.makedirs(relative_apport_dir)75 os.makedirs(relative_apport_dir)
89 templatetools.file_from_template(template_hook_dir, "source_project_name.py", relative_apport_dir, subst_new)76 templatetools.file_from_template(template_hook_dir, "source_project_name.py", relative_apport_dir, subst_new)
9077
91def insert_lpi_if_required(project_name):
92 camel_case_project_name = quickly.templatetools.get_camel_case_name(project_name)
93 existing_base_filename = os.path.join(quickly.templatetools.python_name(project_name) + '_lib',
94 "Window.py")
95 existing_ui_filename = os.path.join("data", "ui", "%sWindow.ui"%camel_case_project_name)
96
97 if os.path.isfile(existing_base_filename) and os.path.isfile(existing_ui_filename):
98 tree = etree.parse(existing_ui_filename)
99 help_menu = find_about_menu(tree)
100
101 if help_menu:
102 existing_base_file = file(existing_base_filename, "r")
103 existing_lines = existing_base_file.readlines()
104 existing_base_file.close()
105 new_lines = detect_or_insert_lpi(existing_lines, project_name, help_menu)
106 if new_lines:
107 print _("Adding launchpad integration to existing application")
108 new_content = ''.join(new_lines)
109 templatetools.set_file_contents(existing_base_filename, new_content)
110 return True
111 return False
112
113def detect_or_insert_lpi(existing_lines, project_name, help_menu):
114 integration_present = False
115 init_insert_line = None
116 current_line = 0
117 for line in existing_lines:
118 if "import LaunchpadIntegration" in line:
119 integration_present = True
120 break
121 if not init_insert_line and "self.builder.connect_signals(self)" in line:
122 init_insert_line = current_line
123 current_line += 1
124
125 if not integration_present and init_insert_line:
126 init_menu_block = LPI_init_menu_block%{"project_name":project_name, "help_menu":help_menu}
127 existing_lines = existing_lines[:init_insert_line+1] + \
128 ["%s\n"%l for l in init_menu_block.splitlines()] + \
129 existing_lines[init_insert_line+1:]
130 return existing_lines
131 else:
132 return None
133
134
135def find_about_menu(tree):78def find_about_menu(tree):
136 """Finds the current help menu in the passed xml document by looking for the gtk-about element"""79 """Finds the current help menu in the passed xml document by looking for the gtk-about element"""
137 help_item = tree.xpath('//property[@name="label" and .="gtk-about"]/../../../@id')80 help_item = tree.xpath('//property[@name="label" and .="gtk-about"]/../../../@id')
13881
=== modified file 'data/templates/ubuntu-application/project_root/python_lib/Window.py'
--- data/templates/ubuntu-application/project_root/python_lib/Window.py 2011-11-07 21:55:54 +0000
+++ data/templates/ubuntu-application/project_root/python_lib/Window.py 2012-05-14 22:57:18 +0000
@@ -52,17 +52,6 @@
52 self.settings = Gio.Settings("net.launchpad.project_name")52 self.settings = Gio.Settings("net.launchpad.project_name")
53 self.settings.connect('changed', self.on_preferences_changed)53 self.settings.connect('changed', self.on_preferences_changed)
5454
55 # Optional Launchpad integration
56 # This shouldn't crash if not found as it is simply used for bug reporting.
57 # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
58 # for more information about Launchpad integration.
59 try:
60 from gi.repository import LaunchpadIntegration # pylint: disable=E0611
61 LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
62 LaunchpadIntegration.set_sourcepackagename('project_name')
63 except ImportError:
64 pass
65
66 # Optional application indicator support55 # Optional application indicator support
67 # Run 'quickly add indicator' to get started.56 # Run 'quickly add indicator' to get started.
68 # More information:57 # More information:
6958
=== removed file 'data/templates/ubuntu-application/test/apport/TestProjectWindow.py.no_lpi'
--- data/templates/ubuntu-application/test/apport/TestProjectWindow.py.no_lpi 2011-03-01 20:12:22 +0000
+++ data/templates/ubuntu-application/test/apport/TestProjectWindow.py.no_lpi 1970-01-01 00:00:00 +0000
@@ -1,102 +0,0 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2### BEGIN LICENSE
3# This file is in the public domain
4### END LICENSE
5
6import gtk
7
8import test.helpers as helpers
9
10import gettext
11from gettext import gettext as _
12gettext.textdomain('test')
13
14
15# This class is meant to be subclassed by TestWindow. It provides
16# common functions and some boilerplate.
17class BaseTestWindow(gtk.Window):
18 __gtype_name__ = "BaseTestWindow"
19
20 # To construct a new instance of this method, the following notable
21 # methods are called in this order:
22 # __new__(cls)
23 # __init__(self)
24 # finish_initializing(self, builder)
25 # __init__(self)
26 #
27 # For this reason, it's recommended you leave __init__ empty and put
28 # your initialization code in finish_initializing
29
30 def __new__(cls):
31 """Special static method that's automatically called by Python when
32 constructing a new instance of this class.
33
34 Returns a fully instantiated BaseTestWindow object.
35 """
36 builder = helpers.get_builder('TestWindow')
37 new_object = builder.get_object("test_window")
38 new_object.finish_initializing(builder)
39 return new_object
40
41 def finish_initializing(self, builder):
42 """Called while initializing this instance in __new__
43
44 finish_initializing should be called after parsing the UI definition
45 and creating a TestWindow object with it in order to finish
46 initializing the start of the new TestWindow instance.
47
48 Put your initilization code in here and leave __init__ undefined.
49 """
50 # Get a reference to the builder and set up the signals.
51 self.builder = builder
52 self.builder.connect_signals(self)
53
54 # Optional application indicator support
55 # Run 'quickly add indicator' to get started.
56 # More information:
57 # http://owaislone.org/quickly-add-indicator/
58 # https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators
59 try:
60 from test import indicator
61 # self is passed so methods of this class can be called from indicator.py
62 # Comment this next line out to disable appindicator
63 self.indicator = indicator.new_application_indicator(self)
64 except:
65 pass
66
67 def load_preferences(self):
68 """Loads preferences into self.preferences"""
69 prefs = PreferencesTestDialog.PreferencesTestDialog()
70 self.preferences = prefs.get_preferences()
71
72 def about(self, widget, data=None):
73 """Display the about box for test."""
74 about = AboutTestDialog.AboutTestDialog()
75 response = about.run()
76 about.destroy()
77
78 def preferences(self, widget, data=None):
79 """Display the preferences window for test."""
80 prefs = PreferencesTestDialog.PreferencesTestDialog()
81 response = prefs.run()
82 if response == gtk.RESPONSE_OK and hasattr(self, 'preferences_updated'):
83 # Add a preferences_updated function to subclasses to react to
84 # changes that a user makes. You'll find such changes in self.preferences
85 self.preferences = prefs.get_preferences() # in case load_preferences was never called
86 self.preferences_updated()
87 prefs.destroy()
88
89 def quit(self, widget, data=None):
90 """Signal handler for closing the TestWindow."""
91 self.destroy()
92
93 def on_destroy(self, widget, data=None):
94 """Called when the TestWindow is closed."""
95 # Clean up code for saving application state should be added here.
96 gtk.main_quit()
97
98
99if __name__ == "__main__":
100 window = BaseTestWindow()
101 window.show()
102 gtk.main()
1030
=== modified file 'data/templates/ubuntu-application/test/apport/apport.sh'
--- data/templates/ubuntu-application/test/apport/apport.sh 2011-11-08 02:27:24 +0000
+++ data/templates/ubuntu-application/test/apport/apport.sh 2012-05-14 22:57:18 +0000
@@ -11,28 +11,12 @@
1111
12cd test-project12cd test-project
1313
14grep LaunchpadIntegration. test_project_lib/Window.py
15# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
16# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
17# LaunchpadIntegration.set_sourcepackagename('test-project')
18
19grep helpMenu test_project_lib/Window.py
20# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
21
22quickly configure lp-project gpoweroff14quickly configure lp-project gpoweroff
23# Get Launchpad Settings15# Get Launchpad Settings
24# Launchpad connection is ok16# Launchpad connection is ok
25# Creating new apport crashdb configuration17# Creating new apport crashdb configuration
26# Creating new apport hooks18# Creating new apport hooks
2719
28grep LaunchpadIntegration. test_project_lib/Window.py
29# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
30# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
31# LaunchpadIntegration.set_sourcepackagename('test-project')
32
33grep helpMenu test_project_lib/Window.py
34# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
35
36bzr status20bzr status
37# modified:21# modified:
38# .quickly22# .quickly
@@ -55,14 +39,6 @@
55# Launchpad connection is ok39# Launchpad connection is ok
56# Updating project name references in existing apport crashdb configuration40# Updating project name references in existing apport crashdb configuration
5741
58grep LaunchpadIntegration. test_project_lib/Window.py
59# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
60# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
61# LaunchpadIntegration.set_sourcepackagename('test-project')
62
63grep helpMenu test_project_lib/Window.py
64# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
65
66bzr status42bzr status
67# added:43# added:
68# apport/44# apport/
@@ -121,14 +97,6 @@
121# Launchpad connection is ok97# Launchpad connection is ok
122# Updating project name references in existing apport crashdb configuration98# Updating project name references in existing apport crashdb configuration
12399
124grep LaunchpadIntegration. test_project_lib/Window.py
125# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
126# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
127# LaunchpadIntegration.set_sourcepackagename('test-project')
128
129grep helpMenu test_project_lib/Window.py
130# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
131
132bzr status100bzr status
133# modified:101# modified:
134# .quickly102# .quickly
@@ -152,14 +120,6 @@
152# Updating project name references in existing apport crashdb configuration120# Updating project name references in existing apport crashdb configuration
153# Creating new apport hooks121# Creating new apport hooks
154122
155grep LaunchpadIntegration. test_project_lib/Window.py
156# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
157# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
158# LaunchpadIntegration.set_sourcepackagename('test-project')
159
160grep helpMenu test_project_lib/Window.py
161# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
162
163cat etc/apport/crashdb.conf.d/test-project-crashdb.conf123cat etc/apport/crashdb.conf.d/test-project-crashdb.conf
164# ### BEGIN LICENSE124# ### BEGIN LICENSE
165# # This file is in the public domain125# # This file is in the public domain
@@ -192,14 +152,6 @@
192# Launchpad connection is ok152# Launchpad connection is ok
193# Updating project name references in existing apport crashdb configuration153# Updating project name references in existing apport crashdb configuration
194154
195grep LaunchpadIntegration. test_project_lib/Window.py
196# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
197# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
198# LaunchpadIntegration.set_sourcepackagename('test-project')
199
200grep helpMenu test_project_lib/Window.py
201# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
202
203cat etc/apport/crashdb.conf.d/test-project-crashdb.conf155cat etc/apport/crashdb.conf.d/test-project-crashdb.conf
204# ### BEGIN LICENSE156# ### BEGIN LICENSE
205# # This file is in the public domain157# # This file is in the public domain
@@ -319,14 +271,6 @@
319# Creating new apport crashdb configuration271# Creating new apport crashdb configuration
320# Creating new apport hooks272# Creating new apport hooks
321273
322grep LaunchpadIntegration. test_project_lib/Window.py
323# from gi.repository import LaunchpadIntegration # pylint: disable=E0611
324# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
325# LaunchpadIntegration.set_sourcepackagename('test-project')
326
327grep helpMenu test_project_lib/Window.py
328# LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
329
330cat etc/apport/crashdb.conf.d/test-project-crashdb.conf274cat etc/apport/crashdb.conf.d/test-project-crashdb.conf
331# ### BEGIN LICENSE275# ### BEGIN LICENSE
332# # This file is in the public domain276# # This file is in the public domain
@@ -354,66 +298,38 @@
354# report['ThirdParty'] = 'True'298# report['ThirdParty'] = 'True'
355# report['CrashDB'] = 'test_project'299# report['CrashDB'] = 'test_project'
356300
357cp "$TEST_SCRIPT_DIR/TestProjectWindow.py.no_lpi" ./test_project_lib/Window.py
358
359cp "$TEST_SCRIPT_DIR/TestProjectWindow.ui.renamed_help_menu" ./data/ui/TestProjectWindow.ui301cp "$TEST_SCRIPT_DIR/TestProjectWindow.ui.renamed_help_menu" ./data/ui/TestProjectWindow.ui
360302
361rm -rf apport303rm -rf apport
362304
363rm -rf etc305rm -rf etc
364306
365grep LaunchpadIntegration. test_project_lib/Window.py
366
367grep helpMenu test_project_lib/Window.py
368
369quickly upgrade 0.3307quickly upgrade 0.3
370# Adding launchpad integration to existing application
371# Creating new apport crashdb configuration308# Creating new apport crashdb configuration
372# Creating new apport hooks309# Creating new apport hooks
373310
374grep LaunchpadIntegration. test_project_lib/Window.py
375# LaunchpadIntegration.add_items(self.ui.differentHelpMenu, 1, True, True)
376# LaunchpadIntegration.set_sourcepackagename('test-project')
377
378cp "$TEST_SCRIPT_DIR/TestProjectWindow.py.no_lpi" ./test_project_lib/Window.py
379
380cp "$TEST_SCRIPT_DIR/TestProjectWindow.ui.no_gtk-about" ./data/ui/TestProjectWindow.ui311cp "$TEST_SCRIPT_DIR/TestProjectWindow.ui.no_gtk-about" ./data/ui/TestProjectWindow.ui
381312
382rm -rf apport313rm -rf apport
383314
384rm -rf etc315rm -rf etc
385316
386grep LaunchpadIntegration. test_project_lib/Window.py
387
388grep helpMenu test_project_lib/Window.py
389
390grep gtk-about data/ui/TestProjectWindow.ui317grep gtk-about data/ui/TestProjectWindow.ui
391318
392bzr commit -m "Committing after removing all lpi integration"319bzr commit -m "Committing after removing all lpi integration"
393# Committing to: /tmp/test-project/320# Committing to: /tmp/test-project/
394# modified data/ui/TestProjectWindow.ui321# modified data/ui/TestProjectWindow.ui
395# modified test_project_lib/Window.py
396# Committed revision 6.322# Committed revision 6.
397323
398quickly upgrade 0.3324quickly upgrade 0.3
399# Creating new apport crashdb configuration325# Creating new apport crashdb configuration
400# Creating new apport hooks326# Creating new apport hooks
401327
402grep LaunchpadIntegration. test_project_lib/Window.py
403
404grep helpMenu test_project_lib/Window.py
405
406bzr status328bzr status
407# unknown:329# unknown:
408# apport/330# apport/
409# etc/331# etc/
410332
411cp "$TEST_SCRIPT_DIR/TestProjectWindow.py.no_lpi" ./test_project_lib/Window.py
412
413rm ./data/ui/TestProjectWindow.ui333rm ./data/ui/TestProjectWindow.ui
414334
415grep LaunchpadIntegration. test_project_lib/Window.py
416
417grep helpMenu test_project_lib/Window.py
418
419quickly upgrade 0.3335quickly upgrade 0.3
420336
=== modified file 'data/templates/ubuntu-application/test/apportutils.py'
--- data/templates/ubuntu-application/test/apportutils.py 2011-04-04 13:22:11 +0000
+++ data/templates/ubuntu-application/test/apportutils.py 2012-05-14 22:57:18 +0000
@@ -17,146 +17,6 @@
17from internal import apportutils17from internal import apportutils
1818
19class TestApportUtils(unittest.TestCase):19class TestApportUtils(unittest.TestCase):
20 def test_lpi_existing(self):
21 lines = """#!/usr/bin/python
22import sys
23import os
24import gtk
25import gettext
26from gettext import gettext as _
27gettext.textdomain('project_name')
28
29# optional Launchpad integration
30# this shouldn't crash if not found as it is simply used for bug reporting
31try:
32 import LaunchpadIntegration
33 launchpad_available = True
34except:
35 launchpad_available = False
36
37class camel_case_nameWindow(gtk.Window):
38 __gtype_name__ = "camel_case_nameWindow"
39
40 def __init__(self):
41 pass
42
43 def finish_initializing(self, builder):
44 # Get a reference to the builder and set up the signals.
45 self.builder = builder
46 self.builder.connect_signals(self)
47
48 if launchpad_available:
49 # see https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding for more information
50 # about LaunchpadIntegration
51 LaunchpadIntegration.set_sourcepackagename('project_name')
52 LaunchpadIntegration.add_items(self.builder.get_object('helpMenu'), 1, True, True)
53
54 def about(self, widget, data=None):
55 about = Aboutcamel_case_nameDialog.NewAboutcamel_case_nameDialog()
56 response = about.run()
57 about.destroy()
58""".splitlines()
59 self.failIf(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1"))
60
61 def test_partial_lpi_import_only(self):
62 lines = """#!/usr/bin/python
63import sys
64import os
65import gtk
66import gettext
67from gettext import gettext as _
68gettext.textdomain('project_name')
69
70# optional Launchpad integration
71# this shouldn't crash if not found as it is simply used for bug reporting
72try:
73 import LaunchpadIntegration
74 launchpad_available = True
75except:
76 launchpad_available = False
77
78class camel_case_nameWindow(gtk.Window):
79 __gtype_name__ = "camel_case_nameWindow"
80
81 def __init__(self):
82 pass
83
84 def finish_initializing(self, builder):
85 # Get a reference to the builder and set up the signals.
86 self.builder = builder
87 self.builder.connect_signals(self)
88
89 def about(self, widget, data=None):
90 about = Aboutcamel_case_nameDialog.NewAboutcamel_case_nameDialog()
91 response = about.run()
92 about.destroy()
93""".splitlines()
94 self.failIf(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1"))
95
96 def test_no_lpi(self):
97 lines = """#!/usr/bin/python
98import sys
99import os
100import gtk
101import gettext
102from gettext import gettext as _
103gettext.textdomain('project_name')
104
105class camel_case_nameWindow(gtk.Window):
106 __gtype_name__ = "camel_case_nameWindow"
107
108 def __init__(self):
109 pass
110
111 def finish_initializing(self, builder):
112 # Get a reference to the builder and set up the signals.
113 self.builder = builder
114 self.builder.connect_signals(self)
115
116 def about(self, widget, data=None):
117 about = Aboutcamel_case_nameDialog.NewAboutcamel_case_nameDialog()
118 response = about.run()
119 about.destroy()
120""".splitlines(True)
121 expected = """#!/usr/bin/python
122import sys
123import os
124import gtk
125import gettext
126from gettext import gettext as _
127gettext.textdomain('project_name')
128
129class camel_case_nameWindow(gtk.Window):
130 __gtype_name__ = "camel_case_nameWindow"
131
132 def __init__(self):
133 pass
134
135 def finish_initializing(self, builder):
136 # Get a reference to the builder and set up the signals.
137 self.builder = builder
138 self.builder.connect_signals(self)
139
140 # Optional Launchpad integration
141 # This shouldn't crash if not found as it is simply used for bug reporting.
142 # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
143 # for more information about Launchpad integration.
144 try:
145 import LaunchpadIntegration
146 LaunchpadIntegration.add_items(self.ui.helpMenu1, 1, True, True)
147 LaunchpadIntegration.set_sourcepackagename('project_name1')
148 except:
149 pass
150
151 def about(self, widget, data=None):
152 about = Aboutcamel_case_nameDialog.NewAboutcamel_case_nameDialog()
153 response = about.run()
154 about.destroy()
155"""
156 # print "".join(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1"))
157 # print "".join(expected.splitlines(True))
158 self.assertEqual("".join(expected.splitlines(True)).strip(), "".join(apportutils.detect_or_insert_lpi(lines, "project_name1", "helpMenu1")).strip())
159
160 def test_find_about_menu(self):20 def test_find_about_menu(self):
161 xml_tree = etree.parse(StringIO.StringIO("""<?xml version="1.0"?>21 xml_tree = etree.parse(StringIO.StringIO("""<?xml version="1.0"?>
162<interface>22<interface>
16323
=== modified file 'data/templates/ubuntu-application/upgrade.py'
--- data/templates/ubuntu-application/upgrade.py 2011-12-22 16:42:11 +0000
+++ data/templates/ubuntu-application/upgrade.py 2012-05-14 22:57:18 +0000
@@ -169,7 +169,6 @@
169 pass169 pass
170170
171 # add apport hooks if launchpad application is configured171 # add apport hooks if launchpad application is configured
172 internal.apportutils.insert_lpi_if_required(project_name)
173 lp_project_name = configurationhandler.project_config.get('lp_id', None)172 lp_project_name = configurationhandler.project_config.get('lp_id', None)
174 if lp_project_name is not None:173 if lp_project_name is not None:
175 internal.apportutils.update_apport(project_name, lp_project_name, lp_project_name)174 internal.apportutils.update_apport(project_name, lp_project_name, lp_project_name)

Subscribers

People subscribed via source and target branches