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
1=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
2--- lib/canonical/launchpad/browser/launchpad.py 2010-03-04 20:19:39 +0000
3+++ lib/canonical/launchpad/browser/launchpad.py 2010-04-05 18:07:31 +0000
4@@ -7,7 +7,6 @@
5 __all__ = [
6 'AppFrontPageSearchView',
7 'ApplicationButtons',
8- 'BrowserWindowDimensions',
9 'DoesNotExistView',
10 'Hierarchy',
11 'IcingContribFolder',
12@@ -998,13 +997,6 @@
13 return self.getFieldError('scope')
14
15
16-class BrowserWindowDimensions(LaunchpadView):
17- """Allow capture of browser window dimensions."""
18-
19- def render(self):
20- return u'Thanks.'
21-
22-
23 class LaunchpadGraphics(LaunchpadView):
24 label = page_title = 'Overview of Launchpad graphics and icons'
25
26
27=== modified file 'lib/canonical/launchpad/zcml/launchpad.zcml'
28--- lib/canonical/launchpad/zcml/launchpad.zcml 2010-03-26 22:57:38 +0000
29+++ lib/canonical/launchpad/zcml/launchpad.zcml 2010-04-05 18:07:31 +0000
30@@ -419,14 +419,6 @@
31 attribute="__call__"
32 />
33
34-<browser:page
35- for="canonical.launchpad.interfaces.ILaunchpadRoot"
36- name="+dims"
37- permission="zope.Public"
38- class="canonical.launchpad.browser.BrowserWindowDimensions"
39- attribute="__call__"
40- />
41-
42 <class class="canonical.launchpad.webapp.publisher.RenamedView">
43 <allow interface="zope.publisher.interfaces.browser.IBrowserPublisher"
44 attributes="__call__"
45
46=== removed file 'lib/lp/testing/registration.py'
47--- lib/lp/testing/registration.py 2009-10-16 19:56:29 +0000
48+++ lib/lp/testing/registration.py 1970-01-01 00:00:00 +0000
49@@ -1,32 +0,0 @@
50-# Copyright 2009 Canonical Ltd. This software is licensed under the
51-# GNU Affero General Public License version 3 (see the file LICENSE).
52-
53-"""Helper functions dealing with registration in tests.
54-"""
55-__metaclass__ = type
56-
57-__all__ = [
58- 'get_captcha_answer',
59- 'set_captcha_answer',
60- ]
61-
62-import re
63-
64-
65-def get_captcha_answer(contents):
66- """Search the browser contents and get the captcha answer."""
67- expr = re.compile("(\d+ .{1} \d+) =")
68- match = expr.search(contents)
69- if match:
70- question = match.group(1)
71- answer = eval(question)
72- return str(answer)
73- return ''
74-
75-
76-def set_captcha_answer(browser, answer=None, prefix=''):
77- """Given a browser, set the login captcha with the correct answer."""
78- if answer is None:
79- answer = get_captcha_answer(browser.contents)
80- browser.getControl(name=prefix + 'captcha_submission').value = (
81- answer)