Merge lp:~sinzui/launchpad/launchapd-apocalypse-1 into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/launchapd-apocalypse-1
Merge into: lp:launchpad
Diff against target: 1378 lines (+397/-347)
37 files modified
cronscripts/process-hwdb-submissions.py (+1/-1)
lib/canonical/launchpad/browser/__init__.py (+1/-1)
lib/canonical/launchpad/browser/launchpad.py (+1/-1)
lib/canonical/launchpad/configure.zcml (+2/-0)
lib/canonical/launchpad/ftests/test_system_documentation.py (+0/-10)
lib/canonical/launchpad/interfaces/__init__.py (+1/-1)
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+1/-1)
lib/canonical/launchpad/scripts/garbo.py (+2/-2)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py (+1/-1)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py (+2/-2)
lib/canonical/launchpad/security.py (+1/-1)
lib/canonical/launchpad/systemhomes.py (+1/-1)
lib/canonical/launchpad/zcml/configure.zcml (+0/-1)
lib/canonical/launchpad/zcml/hwdb.zcml (+0/-276)
lib/lp/bugs/browser/bugtarget.py (+3/-1)
lib/lp/bugs/doc/bug.txt (+1/-1)
lib/lp/bugs/doc/bugtask-search.txt (+2/-2)
lib/lp/bugs/model/bug.py (+5/-10)
lib/lp/bugs/model/bugtask.py (+1/-1)
lib/lp/bugs/tests/test_bugtask.py (+1/-1)
lib/lp/hardwaredb/browser/configure.zcml (+71/-0)
lib/lp/hardwaredb/browser/hwdb.py (+1/-1)
lib/lp/hardwaredb/browser/tests/test_views.py (+39/-0)
lib/lp/hardwaredb/configure.zcml (+190/-0)
lib/lp/hardwaredb/doc/hwdb-access.txt (+5/-5)
lib/lp/hardwaredb/doc/hwdb-device-tables.txt (+3/-3)
lib/lp/hardwaredb/doc/hwdb-submission.txt (+3/-3)
lib/lp/hardwaredb/doc/hwdb.txt (+8/-8)
lib/lp/hardwaredb/model/hwdb.py (+1/-1)
lib/lp/hardwaredb/scripts/hwdbsubmissions.py (+1/-1)
lib/lp/hardwaredb/scripts/tests/test_hwdb_submission_validation.py (+1/-1)
lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt (+1/-1)
lib/lp/hardwaredb/tests/test_doc.py (+36/-0)
lib/lp/registry/model/person.py (+1/-1)
lib/lp/scripts/utilities/sanitizedb.py (+3/-4)
lib/lp/testing/factory.py (+1/-1)
utilities/migrater/migrater.py (+5/-2)
To merge this branch: bzr merge lp:~sinzui/launchpad/launchapd-apocalypse-1
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) code Approve
Edwin Grubbs code Pending
Abel Deuring Pending
Review via email: mp+18462@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (3.5 KiB)

This is my branch to move the hwdb to lp, the first of many branches to
complete the lp code migration.

    reviewer: adeuring

    lp:~sinzui/launchpad/launchapd-apocalypse-1
    Diff size: 1381
    Launchpad bug: https://bugs.launchpad.net/bugs/launchapd-apocalypse-1
    Test command: ./bin/test -vv -t hardwaredb.* -t bugs.*doc/bug.txt
    Pre-implementation: deryck
    Target release: 10.02

Move the hwdb to lp
-------------------

Use the migrater script to move the hwdb classes to the new lp.hardwaredb.

Rules
-----

    * Use the migrater to move the hwdb to the lp tree.
    * Hush lint if it complains.

QA
--

As this is a refactoring, a few sport checks are needed to verify that
the feature is fine:

    * View https://edge.launchpad.net/~sinzui/+hwdb-submissions
    * Verify the page lists.
    * Verify the system link works.

Lint
----

Linting changed files:
  cronscripts/process-hwdb-submissions.py
  lib/canonical/launchpad/configure.zcml
  lib/canonical/launchpad/security.py
  lib/canonical/launchpad/systemhomes.py
  lib/canonical/launchpad/browser/__init__.py
  lib/canonical/launchpad/browser/launchpad.py
  lib/canonical/launchpad/ftests/test_system_documentation.py
  lib/canonical/launchpad/interfaces/__init__.py
  lib/canonical/launchpad/interfaces/_schema_circular_imports.py
  lib/canonical/launchpad/scripts/garbo.py
  lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py
  lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py
  lib/canonical/launchpad/zcml/configure.zcml
  lib/lp/hardwaredb/
  lib/lp/bugs/browser/bugtarget.py
  lib/lp/bugs/doc/bug.txt
  lib/lp/bugs/doc/bugtask-search.txt
  lib/lp/bugs/model/bug.py
  lib/lp/bugs/model/bugtask.py
  lib/lp/bugs/tests/test_bugtask.py
  lib/lp/hardwaredb/__init__.py
  lib/lp/hardwaredb/browser/
  lib/lp/hardwaredb/configure.zcml
  lib/lp/hardwaredb/doc/
  lib/lp/hardwaredb/interfaces/
  lib/lp/hardwaredb/model/
  lib/lp/hardwaredb/scripts/
  lib/lp/hardwaredb/stories/
  lib/lp/hardwaredb/templates/
  lib/lp/hardwaredb/tests/
  lib/lp/hardwaredb/browser/__init__.py
  lib/lp/hardwaredb/browser/configure.zcml
  lib/lp/hardwaredb/browser/hwdb.py
  lib/lp/hardwaredb/browser/tests/
  lib/lp/hardwaredb/browser/tests/__init__.py
  lib/lp/hardwaredb/browser/tests/test_views.py
  lib/lp/hardwaredb/doc/__init__.py
  lib/lp/hardwaredb/doc/hwdb-access.txt
  lib/lp/hardwaredb/doc/hwdb-device-tables.txt
  lib/lp/hardwaredb/doc/hwdb-submission.txt
  lib/lp/hardwaredb/doc/hwdb.txt
  lib/lp/hardwaredb/interfaces/__init__.py
  lib/lp/hardwaredb/model/__init__.py
  lib/lp/hardwaredb/model/hwdb.py
  lib/lp/hardwaredb/scripts/__init__.py
  lib/lp/hardwaredb/scripts/hwdbsubmissions.py
  lib/lp/hardwaredb/scripts/tests/
  lib/lp/hardwaredb/scripts/tests/test_hwdb_submission_validation.py
  lib/lp/hardwaredb/stories/__init__.py
  lib/lp/hardwaredb/stories/hwdb/
  lib/lp/hardwaredb/stories/webservice/
  lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt
  lib/lp/hardwaredb/templates/__init__.py
  lib/lp/hardwaredb/tests/__init__.py
  lib/lp/hardwaredb/tests/test_doc.py
  lib/lp/registry/model/person.py
  lib/lp/scripts/utilities/sanitizedb.py
  lib/lp/testing/factory.p...

Read more...

Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Edwin.

Can you review this for me? I have doubts that my use of "hardwaredb" is good. I wanted a clear term for the module, but all other uses are "hwdb". I think I should rename it to "hwdb" to be consistent.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Thanks for your continued effort to push our codebase forward! Lots of little drive-bys in addition to mechanical changes.

Two minor things we discussed on IRC:
 * Trailing comma at the end of an arguments list.
 * A "try: ... except: pass" block in the migrater may or may not be removed, but needs at least an explanation to help the next coder who hits problems there. Either way is alright with me in this case.

Jeroen

review: Approve
Revision history for this message
Jeroen T. Vermeulen (jtv) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cronscripts/process-hwdb-submissions.py'
2--- cronscripts/process-hwdb-submissions.py 2009-10-13 14:38:07 +0000
3+++ cronscripts/process-hwdb-submissions.py 2010-02-10 23:32:22 +0000
4@@ -24,7 +24,7 @@
5 import _pythonpath
6
7 from lp.services.scripts.base import LaunchpadCronScript
8-from canonical.launchpad.scripts.hwdbsubmissions import (
9+from lp.hardwaredb.scripts.hwdbsubmissions import (
10 process_pending_submissions)
11
12
13
14=== modified file 'lib/canonical/launchpad/browser/__init__.py'
15--- lib/canonical/launchpad/browser/__init__.py 2009-10-22 22:14:48 +0000
16+++ lib/canonical/launchpad/browser/__init__.py 2010-02-10 23:32:22 +0000
17@@ -37,7 +37,7 @@
18 from lp.answers.browser.faqtarget import *
19 from lp.registry.browser.featuredproject import *
20 from canonical.launchpad.browser.feeds import *
21-from canonical.launchpad.browser.hwdb import *
22+from lp.hardwaredb.browser.hwdb import *
23 from lp.registry.browser.karma import *
24 from canonical.launchpad.browser.launchpad import *
25 from canonical.launchpad.browser.launchpadstatistic import *
26
27=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
28--- lib/canonical/launchpad/browser/launchpad.py 2010-01-11 23:43:59 +0000
29+++ lib/canonical/launchpad/browser/launchpad.py 2010-02-10 23:32:22 +0000
30@@ -71,7 +71,7 @@
31 from lp.registry.interfaces.distribution import IDistributionSet
32 from lp.registry.interfaces.karma import IKarmaActionSet
33 from canonical.launchpad.interfaces.account import AccountStatus
34-from canonical.launchpad.interfaces.hwdb import IHWDBApplication
35+from lp.hardwaredb.interfaces.hwdb import IHWDBApplication
36 from lp.services.worlddata.interfaces.language import ILanguageSet
37 from canonical.launchpad.interfaces.launchpad import (
38 IAppFrontPageSearchForm, IBazaarApplication, ILaunchpadCelebrities,
39
40=== modified file 'lib/canonical/launchpad/configure.zcml'
41--- lib/canonical/launchpad/configure.zcml 2010-01-14 13:25:34 +0000
42+++ lib/canonical/launchpad/configure.zcml 2010-02-10 23:32:22 +0000
43@@ -16,6 +16,8 @@
44 <authorizations module="canonical.launchpad.security" />
45 <include package="canonical.launchpad.xmlrpc" />
46
47+ <include package="lp.hardwaredb" />
48+
49 <include package="lp.app" />
50 <include package="lp.bugs" />
51 <include package="lp.registry" />
52
53=== modified file 'lib/canonical/launchpad/ftests/test_system_documentation.py'
54--- lib/canonical/launchpad/ftests/test_system_documentation.py 2010-02-04 17:05:55 +0000
55+++ lib/canonical/launchpad/ftests/test_system_documentation.py 2010-02-10 23:32:22 +0000
56@@ -168,11 +168,6 @@
57 # the harness for the mailinglist-xmlrpc.txt tests, or improving things so
58 # that all this cruft isn't necessary.
59
60-def hwdbDeviceTablesSetup(test):
61- setUp(test)
62- LaunchpadZopelessLayer.switchDbUser('hwdb-submission-processor')
63-
64-
65 def updateRemoteProductSetup(test):
66 """Setup to use the 'updateremoteproduct' db user."""
67 setUp(test)
68@@ -239,11 +234,6 @@
69 tearDown=test_notifications.tearDown,
70 stdout_logging=False, layer=None
71 ),
72- 'hwdb-device-tables.txt': LayeredDocFileSuite(
73- '../doc/hwdb-device-tables.txt',
74- setUp=hwdbDeviceTablesSetup, tearDown=tearDown,
75- layer=LaunchpadZopelessLayer,
76- ),
77 # This test is actually run twice to prove that the AppServerLayer
78 # properly isolates the database between tests.
79 'launchpadlib.txt': LayeredDocFileSuite(
80
81=== modified file 'lib/canonical/launchpad/interfaces/__init__.py'
82--- lib/canonical/launchpad/interfaces/__init__.py 2010-01-20 15:41:25 +0000
83+++ lib/canonical/launchpad/interfaces/__init__.py 2010-02-10 23:32:22 +0000
84@@ -74,7 +74,7 @@
85 from canonical.launchpad.interfaces.geoip import *
86 from lp.registry.interfaces.gpg import *
87 from canonical.launchpad.interfaces.gpghandler import *
88-from canonical.launchpad.interfaces.hwdb import *
89+from lp.hardwaredb.interfaces.hwdb import *
90 from lp.registry.interfaces.irc import *
91 from lp.registry.interfaces.jabber import *
92 from lp.registry.interfaces.karma import *
93
94=== modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py'
95--- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-02-08 14:37:50 +0000
96+++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-02-10 23:32:22 +0000
97@@ -50,7 +50,7 @@
98 IDistributionSourcePackage)
99 from lp.registry.interfaces.distroseries import IDistroSeries
100 from lp.registry.interfaces.person import IPerson, IPersonPublic
101-from canonical.launchpad.interfaces.hwdb import HWBus, IHWSubmission
102+from lp.hardwaredb.interfaces.hwdb import HWBus, IHWSubmission
103 from lp.registry.interfaces.pocket import PackagePublishingPocket
104 from lp.registry.interfaces.product import IProduct
105 from lp.registry.interfaces.productseries import IProductSeries
106
107=== modified file 'lib/canonical/launchpad/scripts/garbo.py'
108--- lib/canonical/launchpad/scripts/garbo.py 2010-01-22 18:03:35 +0000
109+++ lib/canonical/launchpad/scripts/garbo.py 2010-02-10 23:32:22 +0000
110@@ -21,7 +21,7 @@
111 from canonical.database.constants import THIRTY_DAYS_AGO
112 from canonical.database.sqlbase import cursor, sqlvalues
113 from canonical.launchpad.database.emailaddress import EmailAddress
114-from canonical.launchpad.database.hwdb import HWSubmission
115+from lp.hardwaredb.model.hwdb import HWSubmission
116 from canonical.launchpad.database.oauth import OAuthNonce
117 from canonical.launchpad.database.openidconsumer import OpenIDConsumerNonce
118 from canonical.launchpad.interfaces import IMasterStore
119@@ -768,7 +768,7 @@
120 def __init__(self, test_args=None):
121 super(BaseDatabaseGarbageCollector, self).__init__(
122 self.script_name,
123- dbuser=self.script_name.replace('-','_'),
124+ dbuser=self.script_name.replace('-', '_'),
125 test_args=test_args)
126
127 def add_my_options(self):
128
129=== modified file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py'
130--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2010-01-07 06:16:04 +0000
131+++ lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2010-02-10 23:32:22 +0000
132@@ -19,7 +19,7 @@
133 from zope.testing.loghandler import Handler
134
135 from canonical.config import config
136-from canonical.launchpad.scripts.hwdbsubmissions import (SubmissionParser,
137+from lp.hardwaredb.scripts.hwdbsubmissions import (SubmissionParser,
138 ROOT_UDI)
139 from canonical.testing import BaseLayer
140
141
142=== modified file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py'
143--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py 2010-01-07 06:16:04 +0000
144+++ lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py 2010-02-10 23:32:22 +0000
145@@ -16,7 +16,7 @@
146 from zope.testing.loghandler import Handler
147
148 from canonical.config import config
149-from canonical.launchpad.interfaces.hwdb import (
150+from lp.hardwaredb.interfaces.hwdb import (
151 HWBus, HWSubmissionFormat, HWSubmissionProcessingStatus,
152 IHWDeviceDriverLinkSet, IHWDeviceSet, IHWDriverSet,
153 IHWSubmissionDeviceSet, IHWSubmissionSet, IHWVendorIDSet,
154@@ -24,7 +24,7 @@
155 from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
156 from canonical.librarian.ftests.harness import fillLibrarianFile
157 from canonical.librarian.interfaces import LibrarianServerError
158-from canonical.launchpad.scripts.hwdbsubmissions import (
159+from lp.hardwaredb.scripts.hwdbsubmissions import (
160 HALDevice, PCI_CLASS_BRIDGE, PCI_CLASS_SERIALBUS_CONTROLLER,
161 PCI_CLASS_STORAGE, PCI_SUBCLASS_BRIDGE_CARDBUS, PCI_SUBCLASS_BRIDGE_PCI,
162 PCI_SUBCLASS_SERIALBUS_USB, PCI_SUBCLASS_STORAGE_SATA,
163
164=== modified file 'lib/canonical/launchpad/security.py'
165--- lib/canonical/launchpad/security.py 2010-02-08 20:11:17 +0000
166+++ lib/canonical/launchpad/security.py 2010-02-10 23:32:22 +0000
167@@ -51,7 +51,7 @@
168 from lp.translations.interfaces.distroserieslanguage import (
169 IDistroSeriesLanguage)
170 from lp.registry.interfaces.entitlement import IEntitlement
171-from canonical.launchpad.interfaces.hwdb import (
172+from lp.hardwaredb.interfaces.hwdb import (
173 IHWDBApplication, IHWDevice, IHWDeviceClass, IHWDriver, IHWDriverName,
174 IHWDriverPackageName, IHWSubmission, IHWSubmissionDevice, IHWVendorID)
175 from lp.services.worlddata.interfaces.language import ILanguage, ILanguageSet
176
177=== modified file 'lib/canonical/launchpad/systemhomes.py'
178--- lib/canonical/launchpad/systemhomes.py 2010-02-08 11:37:21 +0000
179+++ lib/canonical/launchpad/systemhomes.py 2010-02-10 23:32:22 +0000
180@@ -34,7 +34,7 @@
181 from lp.translations.interfaces.translationgroup import ITranslationGroupSet
182 from lp.translations.interfaces.translationsoverview import (
183 ITranslationsOverview)
184-from canonical.launchpad.interfaces.hwdb import (
185+from lp.hardwaredb.interfaces.hwdb import (
186 IHWDeviceSet, IHWDriverSet, IHWSubmissionDeviceSet, IHWSubmissionSet,
187 IHWVendorIDSet, ParameterError)
188 from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
189
190=== modified file 'lib/canonical/launchpad/zcml/configure.zcml'
191--- lib/canonical/launchpad/zcml/configure.zcml 2009-12-05 18:37:28 +0000
192+++ lib/canonical/launchpad/zcml/configure.zcml 2010-02-10 23:32:22 +0000
193@@ -17,7 +17,6 @@
194 <include file="decoratedresultset.zcml" />
195 <include file="emailaddress.zcml" />
196 <include file="feeds.zcml" />
197- <include file="hwdb.zcml" />
198 <include file="launchpad.zcml" />
199 <include file="launchpadstatistic.zcml" />
200 <include file="librarian.zcml" />
201
202=== removed file 'lib/canonical/launchpad/zcml/hwdb.zcml'
203--- lib/canonical/launchpad/zcml/hwdb.zcml 2009-09-29 00:29:12 +0000
204+++ lib/canonical/launchpad/zcml/hwdb.zcml 1970-01-01 00:00:00 +0000
205@@ -1,276 +0,0 @@
206-<!-- Copyright 2009 Canonical Ltd. This software is licensed under the
207- GNU Affero General Public License version 3 (see the file LICENSE).
208--->
209-
210-<configure
211- xmlns="http://namespaces.zope.org/zope"
212- xmlns:browser="http://namespaces.zope.org/browser"
213- xmlns:i18n="http://namespaces.zope.org/i18n"
214- i18n_domain="launchpad">
215-
216- <!-- HWDBApplication -->
217- <class class="canonical.launchpad.systemhomes.HWDBApplication">
218- <allow interface="lazr.restful.interfaces.ITopLevelEntryLink" />
219- <require
220- permission="launchpad.View"
221- interface="canonical.launchpad.interfaces.IHWDBApplication" />
222- </class>
223-
224- <securedutility
225- class="canonical.launchpad.systemhomes.HWDBApplication"
226- provides="canonical.launchpad.interfaces.IHWDBApplication">
227- <allow interface="lazr.restful.interfaces.ITopLevelEntryLink" />
228- <require
229- permission="launchpad.View"
230- interface="canonical.launchpad.interfaces.IHWDBApplication" />
231- </securedutility>
232-
233- <browser:navigation
234- module="canonical.launchpad.browser"
235- classes="HWDBApplicationNavigation"
236- />
237-
238- <browser:url
239- for="canonical.launchpad.interfaces.IHWDBApplication"
240- path_expression="string:+hwdb"
241- parent_utility="canonical.launchpad.interfaces.ILaunchpadRoot"
242- />
243-
244- <browser:page
245- for="canonical.launchpad.interfaces.IHWDBApplication"
246- class="canonical.launchpad.browser.HWDBUploadView"
247- permission="zope.Public"
248- name="+submit"
249- template="../templates/hwdb-submit-hardware-data.pt"
250- />
251-
252- <class class="canonical.launchpad.database.hwdb.HWSubmission">
253- <require
254- permission="launchpad.View"
255- interface="canonical.launchpad.interfaces.IHWSubmission"
256- attributes="id" />
257- <require
258- permission="launchpad.Edit"
259- set_attributes="status" />
260- </class>
261-
262- <browser:url
263- for="canonical.launchpad.interfaces.IHWSystemFingerprint"
264- path_expression="string:+fingerprint/${fingerprint}"
265- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
266- />
267-
268- <browser:url
269- for="canonical.launchpad.interfaces.IHWSubmission"
270- path_expression="string:+submission/${submission_key}"
271- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
272- />
273-
274- <browser:defaultView
275- for="canonical.launchpad.interfaces.IHWSubmission"
276- name="+text" />
277-
278- <browser:page
279- for="canonical.launchpad.interfaces.IHWSubmission"
280- class="canonical.launchpad.browser.HWDBSubmissionTextView"
281- permission="zope.Public"
282- name="+text"
283- />
284-
285- <securedutility
286- class="canonical.launchpad.database.hwdb.HWSubmissionSet"
287- provides="canonical.launchpad.interfaces.IHWSubmissionSet">
288- <allow interface="canonical.launchpad.interfaces.IHWSubmissionSet" />
289- </securedutility>
290-
291- <class class="canonical.launchpad.database.hwdb.HWSystemFingerprint">
292- <allow
293- interface="canonical.launchpad.interfaces.IHWSystemFingerprint" />
294- </class>
295-
296- <securedutility
297- class="canonical.launchpad.database.hwdb.HWSystemFingerprintSet"
298- provides="canonical.launchpad.interfaces.IHWSystemFingerprintSet">
299- <allow
300- interface="canonical.launchpad.interfaces.IHWSystemFingerprintSet" />
301- </securedutility>
302-
303- <browser:page
304- for="canonical.launchpad.interfaces.IPerson"
305- permission="zope.Public"
306- class="canonical.launchpad.browser.HWDBPersonSubmissionsView"
307- template="../templates/person-hwdb-submissions.pt"
308- name="+hwdb-submissions"
309- />
310-
311- <class class="canonical.launchpad.browser.hwdb.HWDBFingerprintSetView">
312- <allow
313- interface="zope.publisher.interfaces.browser.IBrowserPublisher" />
314- <allow attributes="__call__" />
315- </class>
316-
317- <class class="canonical.launchpad.database.hwdb.HWVendorName">
318- <allow interface="canonical.launchpad.interfaces.IHWVendorName" />
319- <allow attributes="id" />
320- </class>
321-
322- <securedutility
323- class="canonical.launchpad.database.hwdb.HWVendorNameSet"
324- provides="canonical.launchpad.interfaces.IHWVendorNameSet">
325- <allow interface="canonical.launchpad.interfaces.IHWVendorNameSet" />
326- </securedutility>
327-
328- <class class="canonical.launchpad.database.hwdb.HWVendorID">
329- <require
330- permission="launchpad.View"
331- interface="canonical.launchpad.interfaces.IHWVendorID" />
332- </class>
333-
334- <browser:url
335- for="canonical.launchpad.interfaces.IHWVendorID"
336- path_expression="string:+hwvendorid/${id}"
337- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
338- />
339-
340- <securedutility
341- class="canonical.launchpad.database.hwdb.HWVendorIDSet"
342- provides="canonical.launchpad.interfaces.IHWVendorIDSet">
343- <allow interface="canonical.launchpad.interfaces.IHWVendorIDSet" />
344- </securedutility>
345-
346- <class class="canonical.launchpad.database.hwdb.HWDevice">
347- <require
348- permission="launchpad.View"
349- interface="canonical.launchpad.interfaces.IHWDevice" />
350- </class>
351-
352- <browser:url
353- for="canonical.launchpad.interfaces.IHWDevice"
354- path_expression="string:+device/${id}"
355- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
356- />
357-
358- <securedutility
359- class="canonical.launchpad.database.hwdb.HWDeviceSet"
360- provides="canonical.launchpad.interfaces.IHWDeviceSet">
361- <allow interface="canonical.launchpad.interfaces.IHWDeviceSet" />
362- </securedutility>
363-
364- <class class="canonical.launchpad.database.hwdb.HWDeviceNameVariant">
365- <allow interface=
366- "canonical.launchpad.interfaces.IHWDeviceNameVariant" />
367- </class>
368-
369- <securedutility
370- class="canonical.launchpad.database.hwdb.HWDeviceNameVariantSet"
371- provides="canonical.launchpad.interfaces.IHWDeviceNameVariantSet">
372- <allow interface=
373- "canonical.launchpad.interfaces.IHWDeviceNameVariantSet" />
374- </securedutility>
375-
376- <class class="canonical.launchpad.database.hwdb.HWDriver">
377- <require
378- permission="launchpad.View"
379- interface="canonical.launchpad.interfaces.IHWDriver" />
380- </class>
381-
382- <browser:url
383- for="canonical.launchpad.interfaces.IHWDriver"
384- path_expression="string:+driver/${id}"
385- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
386- />
387-
388- <securedutility
389- class="canonical.launchpad.database.hwdb.HWDriverSet"
390- provides="canonical.launchpad.interfaces.IHWDriverSet">
391- <allow
392- interface="canonical.launchpad.interfaces.IHWDriverSet" />
393- </securedutility>
394-
395- <class class="canonical.launchpad.database.hwdb.HWDriverName">
396- <require
397- permission="launchpad.View"
398- interface="canonical.launchpad.interfaces.IHWDriverName" />
399- </class>
400-
401- <browser:url
402- for="canonical.launchpad.interfaces.IHWDriverName"
403- path_expression="string:+drivername/${name}"
404- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
405- />
406-
407- <class class="canonical.launchpad.database.hwdb.HWDriverPackageName">
408- <require
409- permission="launchpad.View"
410- interface="canonical.launchpad.interfaces.IHWDriverPackageName" />
411- </class>
412-
413- <browser:url
414- for="canonical.launchpad.interfaces.IHWDriverPackageName"
415- path_expression="string:+driverpackagename/${package_name}"
416- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
417- />
418-
419- <class class="canonical.launchpad.database.hwdb.HWDeviceDriverLink">
420- <allow
421- interface="canonical.launchpad.interfaces.IHWDeviceDriverLink" />
422- <allow attributes="id" />
423- </class>
424-
425- <securedutility
426- class="canonical.launchpad.database.hwdb.HWDeviceDriverLinkSet"
427- provides="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet">
428- <allow
429- interface="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet" />
430- </securedutility>
431-
432- <class class="canonical.launchpad.database.hwdb.HWDeviceClass">
433- <require permission="launchpad.View"
434- interface="canonical.launchpad.interfaces.IHWDeviceClass" />
435- </class>
436-
437- <browser:url
438- for="canonical.launchpad.interfaces.IHWDeviceClass"
439- path_expression="string:+deviceclass/${id}"
440- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
441- />
442-
443- <securedutility
444- class="canonical.launchpad.database.hwdb.HWDeviceClassSet"
445- provides="canonical.launchpad.interfaces.IHWDeviceClassSet">
446- <allow
447- interface="canonical.launchpad.interfaces.IHWDeviceClassSet" />
448- </securedutility>
449-
450- <class class="canonical.launchpad.database.hwdb.HWSubmissionDevice">
451- <require
452- permission="launchpad.View"
453- interface="canonical.launchpad.interfaces.IHWSubmissionDevice" />
454- </class>
455-
456- <browser:url
457- for="canonical.launchpad.interfaces.IHWSubmissionDevice"
458- path_expression="string:+submissiondevice/${id}"
459- parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
460- />
461-
462- <securedutility
463- class="canonical.launchpad.database.hwdb.HWSubmissionDeviceSet"
464- provides="canonical.launchpad.interfaces.IHWSubmissionDeviceSet">
465- <allow
466- interface="canonical.launchpad.interfaces.IHWSubmissionDeviceSet" />
467- </securedutility>
468-
469- <class class="canonical.launchpad.database.hwdb.HWSubmissionBug">
470- <allow
471- interface="canonical.launchpad.interfaces.IHWSubmissionBug" />
472- <allow attributes="id" />
473- </class>
474-
475- <securedutility
476- class="canonical.launchpad.database.hwdb.HWSubmissionBugSet"
477- provides="canonical.launchpad.interfaces.IHWSubmissionBugSet">
478- <allow
479- interface="canonical.launchpad.interfaces.IHWSubmissionBugSet" />
480- </securedutility>
481-</configure>
482
483=== modified file 'lib/lp/bugs/browser/bugtarget.py'
484--- lib/lp/bugs/browser/bugtarget.py 2010-01-29 19:00:47 +0000
485+++ lib/lp/bugs/browser/bugtarget.py 2010-02-10 23:32:22 +0000
486@@ -51,7 +51,7 @@
487 BugTaskStatus, IBugTaskSet, UNRESOLVED_BUGTASK_STATUSES)
488 from canonical.launchpad.interfaces.launchpad import (
489 IHasExternalBugTracker, ILaunchpadUsage)
490-from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet
491+from lp.hardwaredb.interfaces.hwdb import IHWSubmissionSet
492 from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
493 from canonical.launchpad.interfaces.temporaryblobstorage import (
494 ITemporaryStorageManager)
495@@ -827,6 +827,7 @@
496 Returns a list of dicts, with each dict containing values for
497 "preamble" and "content".
498 """
499+
500 def target_name(target):
501 # IProject can be considered the target of a bug during
502 # the bug filing process, but does not extend IBugTarget
503@@ -871,6 +872,7 @@
504
505 This view exists only to redirect from +filebug-advanced to +filebug.
506 """
507+
508 def initialize(self):
509 filebug_url = canonical_url(
510 self.context, rootsite='bugs', view_name='+filebug')
511
512=== modified file 'lib/lp/bugs/doc/bug.txt'
513--- lib/lp/bugs/doc/bug.txt 2010-01-20 15:39:24 +0000
514+++ lib/lp/bugs/doc/bug.txt 2010-02-10 23:32:22 +0000
515@@ -1512,7 +1512,7 @@
516 submission contains information that could help developers
517 fix the bug.
518
519- >>> from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet
520+ >>> from lp.hardwaredb.interfaces.hwdb import IHWSubmissionSet
521 >>> submission = getUtility(IHWSubmissionSet).getBySubmissionKey(
522 ... 'sample-submission')
523 >>> test_bug.linkHWSubmission(submission)
524
525=== modified file 'lib/lp/bugs/doc/bugtask-search.txt'
526--- lib/lp/bugs/doc/bugtask-search.txt 2010-01-23 21:42:36 +0000
527+++ lib/lp/bugs/doc/bugtask-search.txt 2010-02-10 23:32:22 +0000
528@@ -798,7 +798,7 @@
529 0x0455), which appears in a HWDB submission from Sample Person, bugs
530 reported by him will be returned.
531
532- >>> from canonical.launchpad.interfaces.hwdb import HWBus
533+ >>> from lp.hardwaredb.interfaces.hwdb import HWBus
534 >>> search_params = BugTaskSearchParams(
535 ... user=None, hardware_bus=HWBus.PCI, hardware_vendor_id='0x10de',
536 ... hardware_product_id='0x0455', hardware_owner_is_bug_reporter=True)
537@@ -902,7 +902,7 @@
538 a HWDB submission, where the submission contains the given device or
539 driver.
540
541- >>> from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet
542+ >>> from lp.hardwaredb.interfaces.hwdb import IHWSubmissionSet
543 >>> hw_submission = getUtility(IHWSubmissionSet).getBySubmissionKey(
544 ... 'sample-submission')
545 >>> bug_19 = getUtility(IBugSet).get(19)
546
547=== modified file 'lib/lp/bugs/model/bug.py'
548--- lib/lp/bugs/model/bug.py 2010-01-25 11:41:18 +0000
549+++ lib/lp/bugs/model/bug.py 2010-02-10 23:32:22 +0000
550@@ -46,7 +46,7 @@
551 Message, MessageChunk, MessageSet)
552 from canonical.launchpad.fields import DuplicateBug
553 from canonical.launchpad.helpers import shortlist
554-from canonical.launchpad.interfaces.hwdb import IHWSubmissionBugSet
555+from lp.hardwaredb.interfaces.hwdb import IHWSubmissionBugSet
556 from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
557 from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
558 from canonical.launchpad.interfaces.lpstorm import IStore
559@@ -100,7 +100,7 @@
560 from lp.registry.interfaces.productseries import IProductSeries
561 from lp.registry.interfaces.sourcepackage import ISourcePackage
562 from lp.registry.model.mentoringoffer import MentoringOffer
563-from lp.registry.model.person import Person
564+from lp.registry.model.person import Person, ValidPersonCache
565 from lp.registry.model.pillar import pillar_sort_key
566
567
568@@ -227,7 +227,7 @@
569 prejoins=['owner'],
570 orderBy=['datecreated', 'id'])
571 bug_messages = SQLMultipleJoin(
572- 'BugMessage', joinColumn='bug',orderBy='id')
573+ 'BugMessage', joinColumn='bug', orderBy='id')
574 watches = SQLMultipleJoin(
575 'BugWatch', joinColumn='bug', orderBy=['bugtracker', 'remotebug'])
576 cves = SQLRelatedJoin('Cve', intermediateTable='BugCve',
577@@ -530,7 +530,6 @@
578 # the same time as retrieving the bug subscriptions (as a left
579 # join). However, this ran slowly (far from optimal query
580 # plan), so we're doing it as two queries now.
581- from lp.registry.model.person import Person, ValidPersonCache
582 valid_persons = Store.of(self).find(
583 (Person, ValidPersonCache),
584 Person.id == ValidPersonCache.id,
585@@ -553,7 +552,6 @@
586 the relevant subscribers and rationales will be registered on
587 it.
588 """
589- from lp.registry.model.person import Person
590 subscribers = list(
591 Person.select("""
592 Person.id = BugSubscription.person AND
593@@ -614,7 +612,6 @@
594 if self.private:
595 return []
596
597- from lp.registry.model.person import Person
598 dupe_subscribers = set(
599 Person.select("""
600 Person.id = BugSubscription.person AND
601@@ -969,7 +966,7 @@
602 # one thing they often have to filter for is completeness. We maintain
603 # this single canonical query string here so that it does not have to be
604 # cargo culted into Product, Distribution, ProductSeries etc
605- completeness_clause = """
606+ completeness_clause = """
607 BugTask.bug = Bug.id AND """ + BugTask.completeness_clause
608
609 def canBeAQuestion(self):
610@@ -1109,7 +1106,6 @@
611 # Since we can't prejoin, cache all people at once so we don't
612 # have to do it while rendering, which is a big deal for bugs
613 # with a million comments.
614- from lp.registry.model.person import Person
615 owner_ids = set()
616 for chunk in chunks:
617 if chunk.message.ownerID:
618@@ -1327,8 +1323,7 @@
619 """Get the tags as a sorted list of strings."""
620 tags = [
621 bugtag.tag
622- for bugtag in BugTag.selectBy(bug=self, orderBy='tag')
623- ]
624+ for bugtag in BugTag.selectBy(bug=self, orderBy='tag')]
625 return tags
626
627 def _setTags(self, tags):
628
629=== modified file 'lib/lp/bugs/model/bugtask.py'
630--- lib/lp/bugs/model/bugtask.py 2010-01-23 21:42:36 +0000
631+++ lib/lp/bugs/model/bugtask.py 2010-02-10 23:32:22 +0000
632@@ -1844,7 +1844,7 @@
633 params.hardware_product_id are all not None.
634 """
635 # Avoid cyclic imports.
636- from canonical.launchpad.database.hwdb import (
637+ from lp.hardwaredb.model.hwdb import (
638 HWSubmission, HWSubmissionBug, HWSubmissionDevice,
639 _userCanAccessSubmissionStormClause,
640 make_submission_device_statistics_clause)
641
642=== modified file 'lib/lp/bugs/tests/test_bugtask.py'
643--- lib/lp/bugs/tests/test_bugtask.py 2009-07-17 00:26:05 +0000
644+++ lib/lp/bugs/tests/test_bugtask.py 2010-02-10 23:32:22 +0000
645@@ -12,7 +12,7 @@
646 from lazr.lifecycle.snapshot import Snapshot
647
648 from canonical.launchpad.ftests import login
649-from canonical.launchpad.interfaces.hwdb import HWBus, IHWDeviceSet
650+from lp.hardwaredb.interfaces.hwdb import HWBus, IHWDeviceSet
651 from canonical.launchpad.searchbuilder import all, any
652 from canonical.testing import LaunchpadFunctionalLayer, LaunchpadZopelessLayer
653
654
655=== added directory 'lib/lp/hardwaredb'
656=== added file 'lib/lp/hardwaredb/__init__.py'
657=== added directory 'lib/lp/hardwaredb/browser'
658=== added file 'lib/lp/hardwaredb/browser/__init__.py'
659=== added file 'lib/lp/hardwaredb/browser/configure.zcml'
660--- lib/lp/hardwaredb/browser/configure.zcml 1970-01-01 00:00:00 +0000
661+++ lib/lp/hardwaredb/browser/configure.zcml 2010-02-10 23:32:22 +0000
662@@ -0,0 +1,71 @@
663+<configure
664+ xmlns="http://namespaces.zope.org/zope"
665+ xmlns:browser="http://namespaces.zope.org/browser"
666+ xmlns:i18n="http://namespaces.zope.org/i18n"
667+ xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
668+ i18n_domain="launchpad">
669+ <browser:navigation
670+ module="lp.hardwaredb.browser.hwdb"
671+ classes="
672+ HWDBApplicationNavigation"/>
673+ <browser:url
674+ for="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"
675+ path_expression="string:+hwdb"
676+ parent_utility="canonical.launchpad.interfaces.ILaunchpadRoot"/>
677+ <browser:page
678+ for="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"
679+ class="lp.hardwaredb.browser.hwdb.HWDBUploadView"
680+ permission="zope.Public"
681+ name="+submit"
682+ template="../templates/hwdb-submit-hardware-data.pt"/>
683+ <browser:url
684+ for="lp.hardwaredb.interfaces.hwdb.IHWSystemFingerprint"
685+ path_expression="string:+fingerprint/${fingerprint}"
686+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
687+ <browser:url
688+ for="lp.hardwaredb.interfaces.hwdb.IHWSubmission"
689+ path_expression="string:+submission/${submission_key}"
690+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
691+ <browser:defaultView
692+ for="lp.hardwaredb.interfaces.hwdb.IHWSubmission"
693+ name="+text"/>
694+ <browser:page
695+ for="lp.hardwaredb.interfaces.hwdb.IHWSubmission"
696+ class="lp.hardwaredb.browser.hwdb.HWDBSubmissionTextView"
697+ permission="zope.Public"
698+ name="+text"/>
699+ <browser:page
700+ for="canonical.launchpad.interfaces.IPerson"
701+ permission="zope.Public"
702+ class="lp.hardwaredb.browser.hwdb.HWDBPersonSubmissionsView"
703+ template="../templates/person-hwdb-submissions.pt"
704+ name="+hwdb-submissions"/>
705+ <browser:url
706+ for="lp.hardwaredb.interfaces.hwdb.IHWVendorID"
707+ path_expression="string:+hwvendorid/${id}"
708+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
709+ <browser:url
710+ for="lp.hardwaredb.interfaces.hwdb.IHWDevice"
711+ path_expression="string:+device/${id}"
712+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
713+ <browser:url
714+ for="lp.hardwaredb.interfaces.hwdb.IHWDriver"
715+ path_expression="string:+driver/${id}"
716+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
717+ <browser:url
718+ for="lp.hardwaredb.interfaces.hwdb.IHWDriverName"
719+ path_expression="string:+drivername/${name}"
720+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
721+ <browser:url
722+ for="lp.hardwaredb.interfaces.hwdb.IHWDriverPackageName"
723+ path_expression="string:+driverpackagename/${package_name}"
724+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
725+ <browser:url
726+ for="lp.hardwaredb.interfaces.hwdb.IHWDeviceClass"
727+ path_expression="string:+deviceclass/${id}"
728+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
729+ <browser:url
730+ for="lp.hardwaredb.interfaces.hwdb.IHWSubmissionDevice"
731+ path_expression="string:+submissiondevice/${id}"
732+ parent_utility="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
733+</configure>
734\ No newline at end of file
735
736=== renamed file 'lib/canonical/launchpad/browser/hwdb.py' => 'lib/lp/hardwaredb/browser/hwdb.py'
737--- lib/canonical/launchpad/browser/hwdb.py 2009-10-15 16:32:22 +0000
738+++ lib/lp/hardwaredb/browser/hwdb.py 2010-02-10 23:32:22 +0000
739@@ -22,7 +22,7 @@
740
741 from lp.registry.interfaces.distribution import IDistributionSet
742 from canonical.launchpad.interfaces.launchpad import ILaunchBag, NotFoundError
743-from canonical.launchpad.interfaces.hwdb import (
744+from lp.hardwaredb.interfaces.hwdb import (
745 HWSubmissionMissingFields, IHWDBApplication, IHWDeviceClassSet,
746 IHWDeviceSet, IHWDriverSet, IHWSubmissionDeviceSet, IHWSubmissionForm,
747 IHWSubmissionSet, IHWSystemFingerprintSet, IHWVendorIDSet)
748
749=== added directory 'lib/lp/hardwaredb/browser/tests'
750=== added file 'lib/lp/hardwaredb/browser/tests/__init__.py'
751=== added file 'lib/lp/hardwaredb/browser/tests/test_views.py'
752--- lib/lp/hardwaredb/browser/tests/test_views.py 1970-01-01 00:00:00 +0000
753+++ lib/lp/hardwaredb/browser/tests/test_views.py 2010-02-10 23:32:22 +0000
754@@ -0,0 +1,39 @@
755+# Copyright 2010 Canonical Ltd. This software is licensed under the
756+# GNU Affero General Public License version 3 (see the file LICENSE).
757+
758+"""
759+Run the view tests.
760+"""
761+
762+import logging
763+import os
764+import unittest
765+
766+from canonical.launchpad.testing.systemdocs import (
767+ LayeredDocFileSuite, setUp, tearDown)
768+from canonical.testing import LaunchpadFunctionalLayer
769+
770+
771+here = os.path.dirname(os.path.realpath(__file__))
772+
773+
774+def test_suite():
775+ suite = unittest.TestSuite()
776+ testsdir = os.path.abspath(here)
777+
778+ # Add tests using default setup/teardown
779+ filenames = [filename
780+ for filename in os.listdir(testsdir)
781+ if filename.endswith('.txt')]
782+ # Sort the list to give a predictable order.
783+ filenames.sort()
784+ for filename in filenames:
785+ path = filename
786+ one_test = LayeredDocFileSuite(
787+ path, setUp=setUp, tearDown=tearDown,
788+ layer=LaunchpadFunctionalLayer,
789+ stdout_logging_level=logging.WARNING
790+ )
791+ suite.addTest(one_test)
792+
793+ return suite
794
795=== added file 'lib/lp/hardwaredb/configure.zcml'
796--- lib/lp/hardwaredb/configure.zcml 1970-01-01 00:00:00 +0000
797+++ lib/lp/hardwaredb/configure.zcml 2010-02-10 23:32:22 +0000
798@@ -0,0 +1,190 @@
799+<configure
800+ xmlns="http://namespaces.zope.org/zope"
801+ xmlns:browser="http://namespaces.zope.org/browser"
802+ xmlns:i18n="http://namespaces.zope.org/i18n"
803+ xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
804+ i18n_domain="launchpad">
805+ <include
806+ package=".browser"/>
807+
808+ <!-- HWDBApplication -->
809+
810+ <class
811+ class="canonical.launchpad.systemhomes.HWDBApplication">
812+ <allow
813+ interface="lazr.restful.interfaces.ITopLevelEntryLink"/>
814+ <require
815+ permission="launchpad.View"
816+ interface="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
817+ </class>
818+ <securedutility
819+ class="canonical.launchpad.systemhomes.HWDBApplication"
820+ provides="lp.hardwaredb.interfaces.hwdb.IHWDBApplication">
821+ <allow
822+ interface="lazr.restful.interfaces.ITopLevelEntryLink"/>
823+ <require
824+ permission="launchpad.View"
825+ interface="lp.hardwaredb.interfaces.hwdb.IHWDBApplication"/>
826+ </securedutility>
827+ <class
828+ class="lp.hardwaredb.model.hwdb.HWSubmission">
829+ <require
830+ permission="launchpad.View"
831+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmission"
832+ attributes="
833+ id"/>
834+ <require
835+ permission="launchpad.Edit"
836+ set_attributes="status"/>
837+ </class>
838+ <securedutility
839+ class="lp.hardwaredb.model.hwdb.HWSubmissionSet"
840+ provides="lp.hardwaredb.interfaces.hwdb.IHWSubmissionSet">
841+ <allow
842+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmissionSet"/>
843+ </securedutility>
844+ <class
845+ class="lp.hardwaredb.model.hwdb.HWSystemFingerprint">
846+ <allow
847+ interface="lp.hardwaredb.interfaces.hwdb.IHWSystemFingerprint"/>
848+ </class>
849+ <securedutility
850+ class="lp.hardwaredb.model.hwdb.HWSystemFingerprintSet"
851+ provides="lp.hardwaredb.interfaces.hwdb.IHWSystemFingerprintSet">
852+ <allow
853+ interface="lp.hardwaredb.interfaces.hwdb.IHWSystemFingerprintSet"/>
854+ </securedutility>
855+ <class
856+ class="lp.hardwaredb.browser.hwdb.HWDBFingerprintSetView">
857+ <allow
858+ interface="zope.publisher.interfaces.browser.IBrowserPublisher"/>
859+ <allow
860+ attributes="
861+ __call__"/>
862+ </class>
863+ <class
864+ class="lp.hardwaredb.model.hwdb.HWVendorName">
865+ <allow
866+ interface="lp.hardwaredb.interfaces.hwdb.IHWVendorName"/>
867+ <allow
868+ attributes="
869+ id"/>
870+ </class>
871+ <securedutility
872+ class="lp.hardwaredb.model.hwdb.HWVendorNameSet"
873+ provides="lp.hardwaredb.interfaces.hwdb.IHWVendorNameSet">
874+ <allow
875+ interface="lp.hardwaredb.interfaces.hwdb.IHWVendorNameSet"/>
876+ </securedutility>
877+ <class
878+ class="lp.hardwaredb.model.hwdb.HWVendorID">
879+ <require
880+ permission="launchpad.View"
881+ interface="lp.hardwaredb.interfaces.hwdb.IHWVendorID"/>
882+ </class>
883+ <securedutility
884+ class="lp.hardwaredb.model.hwdb.HWVendorIDSet"
885+ provides="lp.hardwaredb.interfaces.hwdb.IHWVendorIDSet">
886+ <allow
887+ interface="lp.hardwaredb.interfaces.hwdb.IHWVendorIDSet"/>
888+ </securedutility>
889+ <class
890+ class="lp.hardwaredb.model.hwdb.HWDevice">
891+ <require
892+ permission="launchpad.View"
893+ interface="lp.hardwaredb.interfaces.hwdb.IHWDevice"/>
894+ </class>
895+ <securedutility
896+ class="lp.hardwaredb.model.hwdb.HWDeviceSet"
897+ provides="lp.hardwaredb.interfaces.hwdb.IHWDeviceSet">
898+ <allow
899+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceSet"/>
900+ </securedutility>
901+ <class
902+ class="lp.hardwaredb.model.hwdb.HWDeviceNameVariant">
903+ <allow
904+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceNameVariant"/>
905+ </class>
906+ <securedutility
907+ class="lp.hardwaredb.model.hwdb.HWDeviceNameVariantSet"
908+ provides="lp.hardwaredb.interfaces.hwdb.IHWDeviceNameVariantSet">
909+ <allow
910+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceNameVariantSet"/>
911+ </securedutility>
912+ <class
913+ class="lp.hardwaredb.model.hwdb.HWDriver">
914+ <require
915+ permission="launchpad.View"
916+ interface="lp.hardwaredb.interfaces.hwdb.IHWDriver"/>
917+ </class>
918+ <securedutility
919+ class="lp.hardwaredb.model.hwdb.HWDriverSet"
920+ provides="lp.hardwaredb.interfaces.hwdb.IHWDriverSet">
921+ <allow
922+ interface="lp.hardwaredb.interfaces.hwdb.IHWDriverSet"/>
923+ </securedutility>
924+ <class
925+ class="lp.hardwaredb.model.hwdb.HWDriverName">
926+ <require
927+ permission="launchpad.View"
928+ interface="lp.hardwaredb.interfaces.hwdb.IHWDriverName"/>
929+ </class>
930+ <class
931+ class="lp.hardwaredb.model.hwdb.HWDriverPackageName">
932+ <require
933+ permission="launchpad.View"
934+ interface="lp.hardwaredb.interfaces.hwdb.IHWDriverPackageName"/>
935+ </class>
936+ <class
937+ class="lp.hardwaredb.model.hwdb.HWDeviceDriverLink">
938+ <allow
939+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceDriverLink"/>
940+ <allow
941+ attributes="
942+ id"/>
943+ </class>
944+ <securedutility
945+ class="lp.hardwaredb.model.hwdb.HWDeviceDriverLinkSet"
946+ provides="lp.hardwaredb.interfaces.hwdb.IHWDeviceDriverLinkSet">
947+ <allow
948+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceDriverLinkSet"/>
949+ </securedutility>
950+ <class
951+ class="lp.hardwaredb.model.hwdb.HWDeviceClass">
952+ <require
953+ permission="launchpad.View"
954+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceClass"/>
955+ </class>
956+ <securedutility
957+ class="lp.hardwaredb.model.hwdb.HWDeviceClassSet"
958+ provides="lp.hardwaredb.interfaces.hwdb.IHWDeviceClassSet">
959+ <allow
960+ interface="lp.hardwaredb.interfaces.hwdb.IHWDeviceClassSet"/>
961+ </securedutility>
962+ <class
963+ class="lp.hardwaredb.model.hwdb.HWSubmissionDevice">
964+ <require
965+ permission="launchpad.View"
966+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmissionDevice"/>
967+ </class>
968+ <securedutility
969+ class="lp.hardwaredb.model.hwdb.HWSubmissionDeviceSet"
970+ provides="lp.hardwaredb.interfaces.hwdb.IHWSubmissionDeviceSet">
971+ <allow
972+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmissionDeviceSet"/>
973+ </securedutility>
974+ <class
975+ class="lp.hardwaredb.model.hwdb.HWSubmissionBug">
976+ <allow
977+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmissionBug"/>
978+ <allow
979+ attributes="
980+ id"/>
981+ </class>
982+ <securedutility
983+ class="lp.hardwaredb.model.hwdb.HWSubmissionBugSet"
984+ provides="lp.hardwaredb.interfaces.hwdb.IHWSubmissionBugSet">
985+ <allow
986+ interface="lp.hardwaredb.interfaces.hwdb.IHWSubmissionBugSet"/>
987+ </securedutility>
988+</configure>
989\ No newline at end of file
990
991=== added directory 'lib/lp/hardwaredb/doc'
992=== added file 'lib/lp/hardwaredb/doc/__init__.py'
993=== renamed file 'lib/canonical/launchpad/doc/hwdb-access.txt' => 'lib/lp/hardwaredb/doc/hwdb-access.txt'
994--- lib/canonical/launchpad/doc/hwdb-access.txt 2009-08-14 13:03:36 +0000
995+++ lib/lp/hardwaredb/doc/hwdb-access.txt 2010-02-10 23:32:22 +0000
996@@ -34,7 +34,7 @@
997 HWDriver
998 --------
999
1000- >>> from canonical.launchpad.interfaces.hwdb import IHWDriverSet
1001+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDriverSet
1002 >>> login('test@canonical.com')
1003 >>> driver = getUtility(IHWDriverSet).search(name='sd')[0]
1004 >>> logout()
1005@@ -71,7 +71,7 @@
1006 HWVendorID
1007 ----------
1008
1009- >>> from canonical.launchpad.interfaces.hwdb import HWBus, IHWVendorIDSet
1010+ >>> from lp.hardwaredb.interfaces.hwdb import HWBus, IHWVendorIDSet
1011 >>> login('test@canonical.com')
1012 >>> vendor_id = getUtility(IHWVendorIDSet).getByBusAndVendorID(
1013 ... HWBus.PCI, '0x10de')
1014@@ -85,7 +85,7 @@
1015 HWDevice
1016 --------
1017
1018- >>> from canonical.launchpad.interfaces.hwdb import IHWDeviceSet
1019+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDeviceSet
1020 >>> login('test@canonical.com')
1021 >>> device = getUtility(IHWDeviceSet).getByDeviceID(
1022 ... HWBus.PCI, '0x10de', '0x0455')
1023@@ -115,7 +115,7 @@
1024 HWSubmissionDevice
1025 ------------------
1026
1027- >>> from canonical.launchpad.interfaces.hwdb import IHWSubmissionDeviceSet
1028+ >>> from lp.hardwaredb.interfaces.hwdb import IHWSubmissionDeviceSet
1029 >>> login('test@canonical.com')
1030 >>> submission_device = getUtility(IHWSubmissionDeviceSet).get(1)
1031 >>> logout()
1032@@ -129,7 +129,7 @@
1033 Methods of IHWDBApplication
1034 ---------------------------
1035
1036- >>> from canonical.launchpad.interfaces.hwdb import IHWDBApplication
1037+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDBApplication
1038 >>> app = getUtility(IHWDBApplication)
1039 >>> check_authorized_only_for_hwdb_team(app, 'numOwnersOfDevice')
1040 Access for launchpad.anonymous denied
1041
1042=== renamed file 'lib/canonical/launchpad/doc/hwdb-device-tables.txt' => 'lib/lp/hardwaredb/doc/hwdb-device-tables.txt'
1043--- lib/canonical/launchpad/doc/hwdb-device-tables.txt 2009-09-17 21:13:06 +0000
1044+++ lib/lp/hardwaredb/doc/hwdb-device-tables.txt 2010-02-10 23:32:22 +0000
1045@@ -1313,7 +1313,7 @@
1046 Older HWDriver records may store None as the package name. We can
1047 retrieve these records by passing None for package_name...
1048
1049- >>> from canonical.launchpad.database.hwdb import HWDriver
1050+ >>> from lp.hardwaredb.model.hwdb import HWDriver
1051 >>> old_driver = HWDriver(package_name=None, name=u'foo', license=None)
1052 >>> print old_driver.name
1053 foo
1054@@ -1486,7 +1486,7 @@
1055 names. Note that the package name value None (used in older submissions)
1056 is not included.
1057
1058- >>> from canonical.launchpad.database.hwdb import HWDriver
1059+ >>> from lp.hardwaredb.model.hwdb import HWDriver
1060 >>> store.add(HWDriver(name='foo', package_name=None))
1061 <HWDriver at...
1062 >>> for package_name in driver_set.all_package_names():
1063@@ -1906,7 +1906,7 @@
1064 >>> factory.makeHWSubmissionDevice(
1065 ... submission, ide_disk, driver, first_device, 2)
1066 <HWSubmissionDevice at...
1067- >>> from canonical.launchpad.interfaces.hwdb import (
1068+ >>> from lp.hardwaredb.interfaces.hwdb import (
1069 ... HWSubmissionProcessingStatus)
1070 >>> # We consider only submissions in the status PROCESSED for
1071 >>> # statistics.
1072
1073=== renamed file 'lib/canonical/launchpad/doc/hwdb-submission.txt' => 'lib/lp/hardwaredb/doc/hwdb-submission.txt'
1074--- lib/canonical/launchpad/doc/hwdb-submission.txt 2009-05-04 18:05:32 +0000
1075+++ lib/lp/hardwaredb/doc/hwdb-submission.txt 2010-02-10 23:32:22 +0000
1076@@ -23,7 +23,7 @@
1077
1078 >>> from StringIO import StringIO
1079 >>> from zope.component import getUtility
1080- >>> from canonical.launchpad.interfaces import IHWDBApplication
1081+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDBApplication
1082 >>> data = StringIO('some data.')
1083 >>> data.filename = 'hardware-info'
1084 >>> form={'field.date_created': u'2007-08-01',
1085@@ -222,13 +222,13 @@
1086 from a submission and sets the submission state to VALID. If any error
1087 occurs when a submission is processed, its status is set to INVALID and
1088 according error is logged. For details, see
1089-lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py.
1090+lp/hardwaredb/scripts/tests/test_hwdb_submission_processing.py.
1091
1092 We have currently three unprocessed submissions in the database, one
1093 submission with the status PROCESSED and no submissions with the status
1094 INVALID.
1095
1096- >>> from canonical.launchpad.interfaces.hwdb import (
1097+ >>> from lp.hardwaredb.interfaces.hwdb import (
1098 ... HWSubmissionProcessingStatus)
1099 >>> new_submissions = submission_set.getByStatus(
1100 ... HWSubmissionProcessingStatus.SUBMITTED)
1101
1102=== renamed file 'lib/canonical/launchpad/doc/hwdb.txt' => 'lib/lp/hardwaredb/doc/hwdb.txt'
1103--- lib/canonical/launchpad/doc/hwdb.txt 2009-07-13 09:13:16 +0000
1104+++ lib/lp/hardwaredb/doc/hwdb.txt 2010-02-10 23:32:22 +0000
1105@@ -8,7 +8,7 @@
1106 together with the following data:
1107
1108
1109- >>> from canonical.launchpad.interfaces.hwdb import IHWSubmissionSet
1110+ >>> from lp.hardwaredb.interfaces.hwdb import IHWSubmissionSet
1111 >>> sample_submission = getUtility(IHWSubmissionSet).getBySubmissionKey(
1112 ... 'sample-submission')
1113
1114@@ -445,7 +445,7 @@
1115 IHWSubmissionSet.getByStatus(). Only the publicly visible
1116 submissions are returned if no user is specified.
1117
1118- >>> from canonical.launchpad.interfaces.hwdb import (
1119+ >>> from lp.hardwaredb.interfaces.hwdb import (
1120 ... HWSubmissionProcessingStatus)
1121 >>> def print_submissions(submissions):
1122 ... for submission in submissions:
1123@@ -467,7 +467,7 @@
1124 If a user is passed, private submissions of this user are returned too.
1125
1126 >>> login('test@canonical.com')
1127- >>> from canonical.launchpad.interfaces.hwdb import (
1128+ >>> from lp.hardwaredb.interfaces.hwdb import (
1129 ... HWSubmissionProcessingStatus)
1130 >>> new_submissions = hw_submission_set.getByStatus(
1131 ... HWSubmissionProcessingStatus.SUBMITTED, user=sample_person)
1132@@ -481,7 +481,7 @@
1133
1134 Submissions of other users are not returned.
1135
1136- >>> from canonical.launchpad.interfaces.hwdb import (
1137+ >>> from lp.hardwaredb.interfaces.hwdb import (
1138 ... HWSubmissionProcessingStatus)
1139 >>> new_submissions = hw_submission_set.getByStatus(
1140 ... HWSubmissionProcessingStatus.SUBMITTED, user=no_priv)
1141@@ -497,7 +497,7 @@
1142
1143 >>> foobar = getUtility(IPersonSet).getByEmail('foo.bar@canonical.com')
1144 >>> login('foo.bar@canonical.com')
1145- >>> from canonical.launchpad.interfaces.hwdb import (
1146+ >>> from lp.hardwaredb.interfaces.hwdb import (
1147 ... HWSubmissionProcessingStatus)
1148 >>> new_submissions = hw_submission_set.getByStatus(
1149 ... HWSubmissionProcessingStatus.SUBMITTED, user=foobar)
1150@@ -539,7 +539,7 @@
1151 IHWSubmissionBugSet.create().
1152
1153 >>> from lp.bugs.interfaces.bug import IBugSet
1154- >>> from canonical.launchpad.interfaces.hwdb import IHWSubmissionBugSet
1155+ >>> from lp.hardwaredb.interfaces.hwdb import IHWSubmissionBugSet
1156 >>> bug_one = getUtility(IBugSet).get(1)
1157 >>> submission_bug_set = getUtility(IHWSubmissionBugSet)
1158 >>> submission_bug = submission_bug_set.create(
1159@@ -682,7 +682,7 @@
1160 If a device is specified, only those submissions that include
1161 the device are returned.
1162
1163- >>> from canonical.launchpad.interfaces.hwdb import HWBus, IHWDeviceSet
1164+ >>> from lp.hardwaredb.interfaces.hwdb import HWBus, IHWDeviceSet
1165 >>> device_set = getUtility(IHWDeviceSet)
1166 >>> msi_mainboard = device_set.getByDeviceID(
1167 ... HWBus.SYSTEM, 'MSI', 'MS-7369')
1168@@ -693,7 +693,7 @@
1169 If a driver is specified, only those submissions for that driver
1170 are returned.
1171
1172- >>> from canonical.launchpad.interfaces.hwdb import IHWDriverSet
1173+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDriverSet
1174 >>> driver_set = getUtility(IHWDriverSet)
1175 >>> ehci_driver = driver_set.getByPackageAndName(
1176 ... 'linux-image-2.6.24-19-generic', 'ehci_hcd')
1177
1178=== added directory 'lib/lp/hardwaredb/interfaces'
1179=== added file 'lib/lp/hardwaredb/interfaces/__init__.py'
1180=== renamed file 'lib/canonical/launchpad/interfaces/hwdb.py' => 'lib/lp/hardwaredb/interfaces/hwdb.py'
1181=== added directory 'lib/lp/hardwaredb/model'
1182=== added file 'lib/lp/hardwaredb/model/__init__.py'
1183=== renamed file 'lib/canonical/launchpad/database/hwdb.py' => 'lib/lp/hardwaredb/model/hwdb.py'
1184--- lib/canonical/launchpad/database/hwdb.py 2009-08-14 13:03:36 +0000
1185+++ lib/lp/hardwaredb/model/hwdb.py 2010-02-10 23:32:22 +0000
1186@@ -55,7 +55,7 @@
1187 from lp.registry.model.person import Person
1188 from lp.registry.model.teammembership import TeamParticipation
1189 from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries
1190-from canonical.launchpad.interfaces.hwdb import (
1191+from lp.hardwaredb.interfaces.hwdb import (
1192 HWBus, HWSubmissionFormat, HWSubmissionKeyNotUnique,
1193 HWSubmissionProcessingStatus, IHWDevice, IHWDeviceClass,
1194 IHWDeviceClassSet, IHWDeviceDriverLink, IHWDeviceDriverLinkSet,
1195
1196=== added directory 'lib/lp/hardwaredb/scripts'
1197=== added file 'lib/lp/hardwaredb/scripts/__init__.py'
1198=== renamed file 'lib/canonical/launchpad/scripts/hwdbsubmissions.py' => 'lib/lp/hardwaredb/scripts/hwdbsubmissions.py'
1199--- lib/canonical/launchpad/scripts/hwdbsubmissions.py 2009-11-05 15:12:46 +0000
1200+++ lib/lp/hardwaredb/scripts/hwdbsubmissions.py 2010-02-10 23:32:22 +0000
1201@@ -36,7 +36,7 @@
1202 from canonical.cachedproperty import cachedproperty
1203 from canonical.config import config
1204 from canonical.librarian.interfaces import LibrarianServerError
1205-from canonical.launchpad.interfaces.hwdb import (
1206+from lp.hardwaredb.interfaces.hwdb import (
1207 HWBus, HWSubmissionProcessingStatus, IHWDeviceDriverLinkSet, IHWDeviceSet,
1208 IHWDriverSet, IHWSubmissionDeviceSet, IHWSubmissionSet, IHWVendorIDSet,
1209 IHWVendorNameSet)
1210
1211=== added directory 'lib/lp/hardwaredb/scripts/tests'
1212=== renamed file 'lib/canonical/launchpad/scripts/tests/real_hwdb_submission.xml.bz2' => 'lib/lp/hardwaredb/scripts/tests/real_hwdb_submission.xml.bz2'
1213=== renamed file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_validation.py' => 'lib/lp/hardwaredb/scripts/tests/test_hwdb_submission_validation.py'
1214--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_validation.py 2009-09-14 17:38:57 +0000
1215+++ lib/lp/hardwaredb/scripts/tests/test_hwdb_submission_validation.py 2010-02-10 23:32:22 +0000
1216@@ -12,7 +12,7 @@
1217 from zope.testing.loghandler import Handler
1218
1219 from canonical.config import config
1220-from canonical.launchpad.scripts.hwdbsubmissions import SubmissionParser
1221+from lp.hardwaredb.scripts.hwdbsubmissions import SubmissionParser
1222 from canonical.testing import BaseLayer
1223
1224
1225
1226=== added directory 'lib/lp/hardwaredb/stories'
1227=== added file 'lib/lp/hardwaredb/stories/__init__.py'
1228=== added directory 'lib/lp/hardwaredb/stories/hwdb'
1229=== renamed file 'lib/canonical/launchpad/pagetests/hwdb/01-submit-data.txt' => 'lib/lp/hardwaredb/stories/hwdb/01-submit-data.txt'
1230=== renamed file 'lib/canonical/launchpad/pagetests/hwdb/02-view-submissions.txt' => 'lib/lp/hardwaredb/stories/hwdb/02-view-submissions.txt'
1231=== added directory 'lib/lp/hardwaredb/stories/webservice'
1232=== renamed file 'lib/canonical/launchpad/pagetests/webservice/xx-hwdb.txt' => 'lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt'
1233--- lib/canonical/launchpad/pagetests/webservice/xx-hwdb.txt 2009-08-21 19:49:18 +0000
1234+++ lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt 2010-02-10 23:32:22 +0000
1235@@ -226,7 +226,7 @@
1236
1237 >>> from zope.component import getUtility
1238 >>> from canonical.launchpad.ftests import login, logout, ANONYMOUS
1239- >>> from canonical.launchpad.interfaces.hwdb import IHWDriverSet
1240+ >>> from lp.hardwaredb.interfaces.hwdb import IHWDriverSet
1241 >>> login(ANONYMOUS)
1242 >>> driver_set = getUtility(IHWDriverSet)
1243 >>> # A typical graphics card driver
1244
1245=== added directory 'lib/lp/hardwaredb/templates'
1246=== added file 'lib/lp/hardwaredb/templates/__init__.py'
1247=== renamed file 'lib/canonical/launchpad/templates/hwdb-fingerprint-submissions.pt' => 'lib/lp/hardwaredb/templates/hwdb-fingerprint-submissions.pt'
1248=== renamed file 'lib/canonical/launchpad/templates/hwdb-submit-hardware-data.pt' => 'lib/lp/hardwaredb/templates/hwdb-submit-hardware-data.pt'
1249=== renamed file 'lib/canonical/launchpad/templates/person-hwdb-submissions.pt' => 'lib/lp/hardwaredb/templates/person-hwdb-submissions.pt'
1250=== added directory 'lib/lp/hardwaredb/tests'
1251=== added file 'lib/lp/hardwaredb/tests/__init__.py'
1252=== added file 'lib/lp/hardwaredb/tests/test_doc.py'
1253--- lib/lp/hardwaredb/tests/test_doc.py 1970-01-01 00:00:00 +0000
1254+++ lib/lp/hardwaredb/tests/test_doc.py 2010-02-10 23:32:22 +0000
1255@@ -0,0 +1,36 @@
1256+# Copyright 2010 Canonical Ltd. This software is licensed under the
1257+# GNU Affero General Public License version 3 (see the file LICENSE).
1258+
1259+"""
1260+Run the doctests and pagetests.
1261+"""
1262+
1263+import os
1264+
1265+from canonical.launchpad.testing.systemdocs import (
1266+ LayeredDocFileSuite, setUp, tearDown)
1267+from canonical.testing import (
1268+ LaunchpadFunctionalLayer, LaunchpadZopelessLayer)
1269+
1270+from lp.services.testing import build_test_suite
1271+
1272+
1273+here = os.path.dirname(os.path.realpath(__file__))
1274+
1275+
1276+def hwdbDeviceTablesSetup(test):
1277+ setUp(test)
1278+ LaunchpadZopelessLayer.switchDbUser('hwdb-submission-processor')
1279+
1280+
1281+special = {
1282+ 'hwdb-device-tables.txt': LayeredDocFileSuite(
1283+ '../doc/hwdb-device-tables.txt',
1284+ setUp=hwdbDeviceTablesSetup,
1285+ tearDown=tearDown,
1286+ layer=LaunchpadZopelessLayer),
1287+ }
1288+
1289+
1290+def test_suite():
1291+ return build_test_suite(here, special, layer=LaunchpadFunctionalLayer)
1292
1293=== modified file 'lib/lp/registry/model/person.py'
1294--- lib/lp/registry/model/person.py 2010-02-08 14:37:50 +0000
1295+++ lib/lp/registry/model/person.py 2010-02-10 23:32:22 +0000
1296@@ -2356,7 +2356,7 @@
1297 @property
1298 def hardware_submissions(self):
1299 """See `IPerson`."""
1300- from canonical.launchpad.database.hwdb import HWSubmissionSet
1301+ from lp.hardwaredb.model.hwdb import HWSubmissionSet
1302 return HWSubmissionSet().search(owner=self)
1303
1304
1305
1306=== modified file 'lib/lp/scripts/utilities/sanitizedb.py'
1307--- lib/lp/scripts/utilities/sanitizedb.py 2009-12-03 04:50:40 +0000
1308+++ lib/lp/scripts/utilities/sanitizedb.py 2010-02-10 23:32:22 +0000
1309@@ -12,7 +12,7 @@
1310 import subprocess
1311 import sys
1312
1313-from storm.locals import Or, Not
1314+from storm.locals import Or
1315 import transaction
1316 from zope.component import getUtility
1317
1318@@ -278,7 +278,7 @@
1319
1320 def removePrivateHwSubmissions(self):
1321 """Remove all private hardware submissions."""
1322- from canonical.launchpad.database.hwdb import HWSubmission
1323+ from lp.hardwaredb.model.hwdb import HWSubmission
1324 count = self.store.find(
1325 HWSubmission, HWSubmission.private == True).remove()
1326 self.store.flush()
1327@@ -529,7 +529,7 @@
1328 sql = match.group(0)
1329
1330 # Drop the existing constraint so we can recreate it.
1331- drop_sql = 'ALTER TABLE %s DROP CONSTRAINT %s;' % (
1332+ drop_sql = 'ALTER TABLE %s DROP CONSTRAINT %s;' % (
1333 table, constraint)
1334 restore_sql.append(drop_sql)
1335 cascade_sql.append(drop_sql)
1336@@ -604,4 +604,3 @@
1337 def _fail(self, error_message):
1338 self.logger.fatal(error_message)
1339 sys.exit(1)
1340-
1341
1342=== modified file 'lib/lp/testing/factory.py'
1343--- lib/lp/testing/factory.py 2010-02-05 15:06:28 +0000
1344+++ lib/lp/testing/factory.py 2010-02-10 23:32:22 +0000
1345@@ -67,7 +67,7 @@
1346 from canonical.launchpad.interfaces.emailaddress import (
1347 EmailAddressStatus, IEmailAddressSet)
1348 from canonical.launchpad.interfaces.gpghandler import IGPGHandler
1349-from canonical.launchpad.interfaces.hwdb import (
1350+from lp.hardwaredb.interfaces.hwdb import (
1351 HWSubmissionFormat, IHWDeviceDriverLinkSet, IHWSubmissionDeviceSet,
1352 IHWSubmissionSet)
1353 from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
1354
1355=== modified file 'utilities/migrater/migrater.py'
1356--- utilities/migrater/migrater.py 2009-10-16 15:00:22 +0000
1357+++ utilities/migrater/migrater.py 2010-02-10 23:32:22 +0000
1358@@ -34,6 +34,7 @@
1359 tes='testing',
1360 tra='translations',
1361 pkg='registry',
1362+ hdb='hardwaredb',
1363 )
1364
1365 RENAME_MAP = dict(
1366@@ -342,8 +343,10 @@
1367 code = ''.join(special_lines)
1368 helper_pattern = re.compile(r'\b(setUp|tearDown)=(\w*)\b')
1369 helpers = set(match.group(2) for match in helper_pattern.finditer(code))
1370- helpers.remove('setUp')
1371- helpers.remove('tearDown')
1372+ if 'setUp' in helpers:
1373+ helpers.remove('setUp')
1374+ if 'tearDown' in helpers:
1375+ helpers.remove('tearDown')
1376 # Extract the setup and teardown functions.
1377 lines = list(system_doc_lines)
1378 system_doc_lines = []