Merge lp:~salgado/launchpad/remove-crap into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/remove-crap
Merge into: lp:launchpad
Diff against target: 81 lines (+0/-48)
3 files modified
lib/canonical/launchpad/browser/launchpad.py (+0/-8)
lib/canonical/launchpad/zcml/launchpad.zcml (+0/-8)
lib/lp/testing/registration.py (+0/-32)
To merge this branch: bzr merge lp:~salgado/launchpad/remove-crap
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+21724@code.launchpad.net

Description of the change

Remove some more stuff that's no longer used.

The thing to answer captchas is no longer used as we got rid of the
registration and password reset pages. And the +dims hasn't been used
in a looooong time.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/zcml/launchpad.zcml
  lib/canonical/launchpad/browser/launchpad.py

== Pylint notices ==

lib/canonical/launchpad/browser/launchpad.py
    80: [F0401] Unable to import 'lazr.uri' (No module named uri)

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)
Revision history for this message
Guilherme Salgado (salgado) wrote :

Unfortunately, there's a test on c-i-p that depend on get_captcha_answer, so I'll have to wait until we've killed c-i-p to land this

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
--- lib/canonical/launchpad/browser/launchpad.py 2010-03-04 20:19:39 +0000
+++ lib/canonical/launchpad/browser/launchpad.py 2010-04-05 18:07:31 +0000
@@ -7,7 +7,6 @@
7__all__ = [7__all__ = [
8 'AppFrontPageSearchView',8 'AppFrontPageSearchView',
9 'ApplicationButtons',9 'ApplicationButtons',
10 'BrowserWindowDimensions',
11 'DoesNotExistView',10 'DoesNotExistView',
12 'Hierarchy',11 'Hierarchy',
13 'IcingContribFolder',12 'IcingContribFolder',
@@ -998,13 +997,6 @@
998 return self.getFieldError('scope')997 return self.getFieldError('scope')
999998
1000999
1001class BrowserWindowDimensions(LaunchpadView):
1002 """Allow capture of browser window dimensions."""
1003
1004 def render(self):
1005 return u'Thanks.'
1006
1007
1008class LaunchpadGraphics(LaunchpadView):1000class LaunchpadGraphics(LaunchpadView):
1009 label = page_title = 'Overview of Launchpad graphics and icons'1001 label = page_title = 'Overview of Launchpad graphics and icons'
10101002
10111003
=== modified file 'lib/canonical/launchpad/zcml/launchpad.zcml'
--- lib/canonical/launchpad/zcml/launchpad.zcml 2010-03-26 22:57:38 +0000
+++ lib/canonical/launchpad/zcml/launchpad.zcml 2010-04-05 18:07:31 +0000
@@ -419,14 +419,6 @@
419 attribute="__call__"419 attribute="__call__"
420 />420 />
421421
422<browser:page
423 for="canonical.launchpad.interfaces.ILaunchpadRoot"
424 name="+dims"
425 permission="zope.Public"
426 class="canonical.launchpad.browser.BrowserWindowDimensions"
427 attribute="__call__"
428 />
429
430<class class="canonical.launchpad.webapp.publisher.RenamedView">422<class class="canonical.launchpad.webapp.publisher.RenamedView">
431 <allow interface="zope.publisher.interfaces.browser.IBrowserPublisher"423 <allow interface="zope.publisher.interfaces.browser.IBrowserPublisher"
432 attributes="__call__"424 attributes="__call__"
433425
=== removed file 'lib/lp/testing/registration.py'
--- lib/lp/testing/registration.py 2009-10-16 19:56:29 +0000
+++ lib/lp/testing/registration.py 1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Helper functions dealing with registration in tests.
5"""
6__metaclass__ = type
7
8__all__ = [
9 'get_captcha_answer',
10 'set_captcha_answer',
11 ]
12
13import re
14
15
16def get_captcha_answer(contents):
17 """Search the browser contents and get the captcha answer."""
18 expr = re.compile("(\d+ .{1} \d+) =")
19 match = expr.search(contents)
20 if match:
21 question = match.group(1)
22 answer = eval(question)
23 return str(answer)
24 return ''
25
26
27def set_captcha_answer(browser, answer=None, prefix=''):
28 """Given a browser, set the login captcha with the correct answer."""
29 if answer is None:
30 answer = get_captcha_answer(browser.contents)
31 browser.getControl(name=prefix + 'captcha_submission').value = (
32 answer)