Merge lp:~adeuring/launchpad/bug-438169-parse-sysfs-attr into lp:launchpad/db-devel

Proposed by Abel Deuring
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~adeuring/launchpad/bug-438169-parse-sysfs-attr
Merge into: lp:launchpad/db-devel
Diff against target: 569 lines
8 files modified
lib/canonical/launchpad/database/__init__.py (+0/-2)
lib/canonical/launchpad/doc/hwdb-device-tables.txt (+1/-1)
lib/canonical/launchpad/scripts/hwdbsubmissions.py (+77/-0)
lib/canonical/launchpad/scripts/tests/hardwaretest-udev.xml (+13/-4)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py (+164/-0)
lib/canonical/launchpad/zcml/hwdb.zcml (+23/-23)
lib/canonical/launchpad/zcml/launchpadstatistic.zcml (+3/-3)
lib/lp/code/model/tests/test_branchjob.py (+19/-0)
To merge this branch: bzr merge lp:~adeuring/launchpad/bug-438169-parse-sysfs-attr
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+12581@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :

This branch adds a method _parseSysfsAttributes to the class SubmisisonParser.

The HWDB client in Karmic will no longer submit data from HAL; instead the data will come from udev, the content from some sysfs files etc. The new method parses the content from the new XML node <sysfs-attributes>.

Additonially I changed the content of the sample submission file l/c/l/scripts/tests/hardwaretest-udev.xml to reflect the real content sent by the HWDB client.

test: ./bin/test -t test_hwdb_submission_parser

= 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/scripts/hwdbsubmissions.py
  lib/canonical/launchpad/scripts/tests/hardwaretest-udev.xml
  lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py

== Pyflakes notices ==

lib/canonical/launchpad/scripts/hwdbsubmissions.py
    22: redefinition of unused 'etree' from line 20

lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py
    10: redefinition of unused 'etree' from line 8

== Pylint notices ==

lib/canonical/launchpad/scripts/hwdbsubmissions.py
    20: [F0401] Unable to import 'xml.etree.cElementTree' (No module named etree)

lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py
    8: [F0401] Unable to import 'xml.etree.cElementTree' (No module named etree)

These messages are not related to the new methods.

Revision history for this message
Graham Binns (gmb) wrote :

I'm happy for this to land with the following changes:

 - Use dedent() in the tests to prevent ugly alignment issues.
 - Clean up the leading braces of the dicts in the assertEqual() call as discussed on IRC.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/database/__init__.py'
--- lib/canonical/launchpad/database/__init__.py 2009-08-27 07:05:16 +0000
+++ lib/canonical/launchpad/database/__init__.py 2009-09-29 11:33:15 +0000
@@ -58,7 +58,6 @@
58from canonical.launchpad.database.personnotification import *58from canonical.launchpad.database.personnotification import *
59from canonical.launchpad.database.packaging import *59from canonical.launchpad.database.packaging import *
60from canonical.launchpad.database.librarian import *60from canonical.launchpad.database.librarian import *
61from canonical.launchpad.database.launchpadstatistic import *
62from canonical.launchpad.database.binaryandsourcepackagename import *61from canonical.launchpad.database.binaryandsourcepackagename import *
63from canonical.launchpad.database.message import *62from canonical.launchpad.database.message import *
64from canonical.launchpad.database.structuralsubscription import *63from canonical.launchpad.database.structuralsubscription import *
@@ -66,4 +65,3 @@
66from canonical.launchpad.database.temporaryblobstorage import *65from canonical.launchpad.database.temporaryblobstorage import *
67from canonical.launchpad.database.emailaddress import *66from canonical.launchpad.database.emailaddress import *
68from canonical.launchpad.database.oauth import *67from canonical.launchpad.database.oauth import *
69from canonical.launchpad.database.hwdb import *
7068
=== modified file 'lib/canonical/launchpad/doc/hwdb-device-tables.txt'
--- lib/canonical/launchpad/doc/hwdb-device-tables.txt 2009-08-14 13:03:36 +0000
+++ lib/canonical/launchpad/doc/hwdb-device-tables.txt 2009-09-29 11:33:15 +0000
@@ -1486,7 +1486,7 @@
1486names. Note that the package name value None (used in older submissions)1486names. Note that the package name value None (used in older submissions)
1487is not included.1487is not included.
14881488
1489 >>> from canonical.launchpad.database import HWDriver1489 >>> from canonical.launchpad.database.hwdb import HWDriver
1490 >>> store.add(HWDriver(name='foo', package_name=None))1490 >>> store.add(HWDriver(name='foo', package_name=None))
1491 <HWDriver at...1491 <HWDriver at...
1492 >>> for package_name in driver_set.all_package_names():1492 >>> for package_name in driver_set.all_package_names():
14931493
=== modified file 'lib/canonical/launchpad/scripts/hwdbsubmissions.py'
--- lib/canonical/launchpad/scripts/hwdbsubmissions.py 2009-09-28 11:33:57 +0000
+++ lib/canonical/launchpad/scripts/hwdbsubmissions.py 2009-09-29 11:33:15 +0000
@@ -556,6 +556,82 @@
556 dmi_data[record[0]] = record[1]556 dmi_data[record[0]] = record[1]
557 return dmi_data557 return dmi_data
558558
559 def _parseSysfsAttributes(self, sysfs_node):
560 """Parse the <sysfs-attributes> node.
561
562 :return: A dictionary {path: attrs, ...} where path is the
563 path is the path of a sysfs directory, and where attrs
564 is a dictionary containing attribute names and values.
565
566 A sample of the input data:
567
568 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
569 A: modalias=input:b0019v0000p0001e0000-e0,1,k74,ramlsfw
570 A: uniq=
571 A: phys=LNXPWRBN/button/input0
572 A: name=Power Button
573
574 P: /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:03/input/input8
575 A: modalias=input:b0019v0000p0006e0000-e0,1,kE0,E1,E3,F0,F1
576 A: uniq=
577 A: phys=/video/input0
578 A: name=Video Bus
579
580 Data for different devices is separated by empty lines. The data
581 for each device starts with a line 'P: /devices/LNXSYSTM...',
582 specifying the sysfs path of a device, followed by zero or more
583 lines of the form 'A: key=value'
584 """
585 sysfs_lines = sysfs_node.text.split('\n')
586 sysfs_data = {}
587 attributes = None
588
589 for line_number, line in enumerate(sysfs_lines):
590 if len(line) == 0:
591 attributes = None
592 continue
593 record = line.split(': ', 1)
594 if len(record) != 2:
595 self._logError(
596 'Line %i in <sysfs-attributes>: No valid key:value data: '
597 '%r' % (line_number, line),
598 self.submission_key)
599 return None
600
601 key, value = record
602 if key == 'P':
603 if attributes is not None:
604 self._logError(
605 "Line %i in <sysfs-attributes>: duplicate 'P' line "
606 "found: %r" % (line_number, line),
607 self.submission_key)
608 return None
609 attributes = {}
610 sysfs_data[value] = attributes
611 elif key == 'A':
612 if attributes is None:
613 self._logError(
614 "Line %i in <sysfs-attributes>: Block for a device "
615 "does not start with 'P:': %r" % (line_number, line),
616 self.submission_key)
617 return None
618 attribute_data = value.split('=', 1)
619 if len(attribute_data) != 2:
620 self._logError(
621 'Line %i in <sysfs-attributes>: Attribute line does '
622 'not contain key=value data: %r'
623 % (line_number, line),
624 self.submission_key)
625 return None
626 attributes[attribute_data[0]] = attribute_data[1]
627 else:
628 self._logError(
629 'Line %i in <sysfs-attributes>: Unexpected key: %r'
630 % (line_number, line),
631 self.submission_key)
632 return None
633 return sysfs_data
634
559 def _setHardwareSectionParsers(self):635 def _setHardwareSectionParsers(self):
560 self._parse_hardware_section = {636 self._parse_hardware_section = {
561 'hal': self._parseHAL,637 'hal': self._parseHAL,
@@ -563,6 +639,7 @@
563 'aliases': self._parseAliases,639 'aliases': self._parseAliases,
564 'udev': self._parseUdev,640 'udev': self._parseUdev,
565 'dmi': self._parseDmi,641 'dmi': self._parseDmi,
642 'sysfs-attributes': self._parseSysfsAttributes,
566 }643 }
567644
568 def _parseHardware(self, hardware_node):645 def _parseHardware(self, hardware_node):
569646
=== modified file 'lib/canonical/launchpad/scripts/tests/hardwaretest-udev.xml'
--- lib/canonical/launchpad/scripts/tests/hardwaretest-udev.xml 2009-09-14 09:16:45 +0000
+++ lib/canonical/launchpad/scripts/tests/hardwaretest-udev.xml 2009-09-29 11:33:15 +0000
@@ -184,10 +184,19 @@
184 is stored in the same format as the DMI data:184 is stored in the same format as the DMI data:
185 /path/to/file:filecontent185 /path/to/file:filecontent
186 -->186 -->
187 <sysfs-attributes>/sys/devices/pci0000:00/0000:00:1f.1/host3/target3:0:0/3:0:0:0/vendor:HL-DT-ST187 <sysfs-attributes>
188/sys/devices/pci0000:00/0000:00:1f.1/host3/target3:0:0/3:0:0:0/model:DVDRAM GSA-4083N188P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
189/sys/devices/pci0000:00/0000:00:1f.1/host3/target3:0:0/3:0:0:0/type:5189A: modalias=input:b0019v0000p0001e0000-e0,1,k74,ramlsfw
190 </sysfs-attributes>190A: uniq=
191A: phys=LNXPWRBN/button/input0
192A: name=Power Button
193
194P: /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:03/input/input8
195A: modalias=input:b0019v0000p0006e0000-e0,1,kE0,E1,E3,F0,F1,F2,F3,F4,F5,ramlsfw
196A: uniq=
197A: phys=/video/input0
198A: name=Video Bus
199</sysfs-attributes>
191200
192 <!-- processors: Data about processors installed in a system.201 <!-- processors: Data about processors installed in a system.
193 The data is retrieved from /proc/cpuinfo.202 The data is retrieved from /proc/cpuinfo.
194203
=== modified file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py'
--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2009-09-28 12:35:40 +0000
+++ lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2009-09-29 11:33:15 +0000
@@ -11,6 +11,7 @@
11from datetime import datetime11from datetime import datetime
12import logging12import logging
13import os13import os
14from textwrap import dedent
14from unittest import TestCase, TestLoader15from unittest import TestCase, TestLoader
1516
16import pytz17import pytz
@@ -649,6 +650,169 @@
649 parser.submission_key,650 parser.submission_key,
650 "Line 1 in <dmi>: No valid key:value data: 'invalid line'")651 "Line 1 in <dmi>: No valid key:value data: 'invalid line'")
651652
653 def testSysfsAttributes(self):
654 """Test of SubmissionParser._parseSysfsAttributes().
655
656 The content of the <sys-attributes> node is converted into
657 a dictionary.
658 """
659 parser = SubmissionParser(self.log)
660 node = etree.fromstring(dedent("""
661 <sysfs-attributes>
662 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
663 A: modalias=input:b0019v0000p0001e0000-e0,1,k74
664 A: uniq=
665 A: phys=LNXPWRBN/button/input0
666 A: name=Power Button
667
668 P: /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:03
669 A: uniq=
670 A: phys=/video/input0
671 A: name=Video Bus
672 </sysfs-attributes>
673 """))
674 result = parser._parseSysfsAttributes(node)
675 self.assertEqual(
676 {
677 '/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0': {
678 'modalias': 'input:b0019v0000p0001e0000-e0,1,k74',
679 'uniq': '',
680 'phys': 'LNXPWRBN/button/input0',
681 'name': 'Power Button',
682 },
683 '/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:03': {
684 'uniq': '',
685 'phys': '/video/input0',
686 'name': 'Video Bus',
687 },
688
689 },
690 result,
691 'Invalid parsing result of <sysfs-attributes> node.')
692
693 def testSysfsAttributesLineWithoutKeyValueData(self):
694 """Test of SubmissionParser._parseSysfsAttributes().
695
696 Lines not in key: value format are rejected.
697 """
698 parser = SubmissionParser(self.log)
699 parser.submission_key = (
700 'Detect <sysfs-attributes> lines not in key:value format')
701 node = etree.fromstring(dedent("""
702 <sysfs-attributes>
703 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
704 A: modalias=input:b0019v0000p0001e0000-e0,1,k74
705 invalid line
706 </sysfs-attributes>
707 """))
708 result = parser._parseSysfsAttributes(node)
709 self.assertEqual(
710 None, result,
711 'Invalid parsing result of a <sysfs-attributes> node containing '
712 'a line not in key:value format.')
713 self.assertErrorMessage(
714 parser.submission_key,
715 "Line 3 in <sysfs-attributes>: No valid key:value data: "
716 "'invalid line'")
717
718 def testSysfsAttributesDuplicatePLine(self):
719 """Test of SubmissionParser._parseSysfsAttributes().
720
721 A line starting with "P:" must be the first line of a device block.
722 """
723 parser = SubmissionParser(self.log)
724 parser.submission_key = (
725 'Detect <sysfs-attributes> node with duplicate P: line')
726 node = etree.fromstring(dedent("""
727 <sysfs-attributes>
728 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
729 A: modalias=input:b0019v0000p0001e0000-e0,1,k74
730 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
731 </sysfs-attributes>
732 """))
733 result = parser._parseSysfsAttributes(node)
734 self.assertEqual(
735 None, result,
736 'Invalid parsing result of a <sysfs-attributes> node containing '
737 'a duplicate P: line.')
738 self.assertErrorMessage(
739 parser.submission_key,
740 "Line 3 in <sysfs-attributes>: duplicate 'P' line found: "
741 "'P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0'")
742
743 def testSysfsAttributesNoPLineAtDeviceStart(self):
744 """Test of SubmissionParser._parseSysfsAttributes().
745
746 The data for a device must start with a "P:" line.
747 """
748 parser = SubmissionParser(self.log)
749 parser.submission_key = (
750 'Detect <sysfs-attributes> node without leading P: line')
751 node = etree.fromstring(dedent("""
752 <sysfs-attributes>
753 A: modalias=input:b0019v0000p0001e0000-e0,1,k74
754 </sysfs-attributes>
755 """))
756 result = parser._parseSysfsAttributes(node)
757 self.assertEqual(
758 None, result,
759 'Invalid parsing result of a <sysfs-attributes> node where a '
760 'device block does not start with a "P": line.')
761 self.assertErrorMessage(
762 parser.submission_key,
763 "Line 1 in <sysfs-attributes>: Block for a device does not "
764 "start with 'P:': "
765 "'A: modalias=input:b0019v0000p0001e0000-e0,1,k74'")
766
767 def testSysfsAttributesNoAttributeKeyValue(self):
768 """Test of SubmissionParser._parseSysfsAttributes().
769
770 A line starting with "A:" must be in key=value format.
771 """
772 parser = SubmissionParser(self.log)
773 parser.submission_key = (
774 'Detect <sysfs-attributes> node with A: line not in key=value '
775 'format')
776 node = etree.fromstring(dedent("""
777 <sysfs-attributes>
778 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
779 A: equal sign is missing
780 </sysfs-attributes>
781 """))
782 result = parser._parseSysfsAttributes(node)
783 self.assertEqual(
784 None, result,
785 'Invalid parsing result of a <sysfs-attributes> node with A: '
786 'line not in key=value format.')
787 self.assertErrorMessage(
788 parser.submission_key,
789 "Line 2 in <sysfs-attributes>: Attribute line does not contain "
790 "key=value data: 'A: equal sign is missing'")
791
792 def testSysfsAttributesInvalidMainKey(self):
793 """Test of SubmissionParser._parseSysfsAttributes().
794
795 All lines must start with "P:" or "A:".
796 """
797 parser = SubmissionParser(self.log)
798 parser.submission_key = (
799 'Detect <sysfs-attributes> node with invalid main key.')
800 node = etree.fromstring(dedent("""
801 <sysfs-attributes>
802 P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
803 X: an invalid line
804 </sysfs-attributes>
805 """))
806 result = parser._parseSysfsAttributes(node)
807 self.assertEqual(
808 None, result,
809 'Invalid parsing result of a <sysfs-attributes> node containg '
810 'a line that does not start with "A:" or "P:".')
811 self.assertErrorMessage(
812 parser.submission_key,
813 "Line 2 in <sysfs-attributes>: Unexpected key: "
814 "'X: an invalid line'")
815
652 def testHardware(self):816 def testHardware(self):
653 """The <hardware> tag is converted into a dictionary."""817 """The <hardware> tag is converted into a dictionary."""
654 test = self818 test = self
655819
=== modified file 'lib/canonical/launchpad/zcml/hwdb.zcml'
--- lib/canonical/launchpad/zcml/hwdb.zcml 2009-08-14 13:03:36 +0000
+++ lib/canonical/launchpad/zcml/hwdb.zcml 2009-09-29 11:33:15 +0000
@@ -44,7 +44,7 @@
44 template="../templates/hwdb-submit-hardware-data.pt"44 template="../templates/hwdb-submit-hardware-data.pt"
45 />45 />
4646
47 <class class="canonical.launchpad.database.HWSubmission">47 <class class="canonical.launchpad.database.hwdb.HWSubmission">
48 <require48 <require
49 permission="launchpad.View"49 permission="launchpad.View"
50 interface="canonical.launchpad.interfaces.IHWSubmission"50 interface="canonical.launchpad.interfaces.IHWSubmission"
@@ -78,18 +78,18 @@
78 />78 />
7979
80 <securedutility80 <securedutility
81 class="canonical.launchpad.database.HWSubmissionSet"81 class="canonical.launchpad.database.hwdb.HWSubmissionSet"
82 provides="canonical.launchpad.interfaces.IHWSubmissionSet">82 provides="canonical.launchpad.interfaces.IHWSubmissionSet">
83 <allow interface="canonical.launchpad.interfaces.IHWSubmissionSet" />83 <allow interface="canonical.launchpad.interfaces.IHWSubmissionSet" />
84 </securedutility>84 </securedutility>
8585
86 <class class="canonical.launchpad.database.HWSystemFingerprint">86 <class class="canonical.launchpad.database.hwdb.HWSystemFingerprint">
87 <allow87 <allow
88 interface="canonical.launchpad.interfaces.IHWSystemFingerprint" />88 interface="canonical.launchpad.interfaces.IHWSystemFingerprint" />
89 </class>89 </class>
9090
91 <securedutility91 <securedutility
92 class="canonical.launchpad.database.HWSystemFingerprintSet"92 class="canonical.launchpad.database.hwdb.HWSystemFingerprintSet"
93 provides="canonical.launchpad.interfaces.IHWSystemFingerprintSet">93 provides="canonical.launchpad.interfaces.IHWSystemFingerprintSet">
94 <allow94 <allow
95 interface="canonical.launchpad.interfaces.IHWSystemFingerprintSet" />95 interface="canonical.launchpad.interfaces.IHWSystemFingerprintSet" />
@@ -109,18 +109,18 @@
109 <allow attributes="__call__" />109 <allow attributes="__call__" />
110 </class>110 </class>
111111
112 <class class="canonical.launchpad.database.HWVendorName">112 <class class="canonical.launchpad.database.hwdb.HWVendorName">
113 <allow interface="canonical.launchpad.interfaces.IHWVendorName" />113 <allow interface="canonical.launchpad.interfaces.IHWVendorName" />
114 <allow attributes="id" />114 <allow attributes="id" />
115 </class>115 </class>
116116
117 <securedutility117 <securedutility
118 class="canonical.launchpad.database.HWVendorNameSet"118 class="canonical.launchpad.database.hwdb.HWVendorNameSet"
119 provides="canonical.launchpad.interfaces.IHWVendorNameSet">119 provides="canonical.launchpad.interfaces.IHWVendorNameSet">
120 <allow interface="canonical.launchpad.interfaces.IHWVendorNameSet" />120 <allow interface="canonical.launchpad.interfaces.IHWVendorNameSet" />
121 </securedutility>121 </securedutility>
122122
123 <class class="canonical.launchpad.database.HWVendorID">123 <class class="canonical.launchpad.database.hwdb.HWVendorID">
124 <require124 <require
125 permission="launchpad.View"125 permission="launchpad.View"
126 interface="canonical.launchpad.interfaces.IHWVendorID" />126 interface="canonical.launchpad.interfaces.IHWVendorID" />
@@ -133,12 +133,12 @@
133 />133 />
134134
135 <securedutility135 <securedutility
136 class="canonical.launchpad.database.HWVendorIDSet"136 class="canonical.launchpad.database.hwdb.HWVendorIDSet"
137 provides="canonical.launchpad.interfaces.IHWVendorIDSet">137 provides="canonical.launchpad.interfaces.IHWVendorIDSet">
138 <allow interface="canonical.launchpad.interfaces.IHWVendorIDSet" />138 <allow interface="canonical.launchpad.interfaces.IHWVendorIDSet" />
139 </securedutility>139 </securedutility>
140140
141 <class class="canonical.launchpad.database.HWDevice">141 <class class="canonical.launchpad.database.hwdb.HWDevice">
142 <require142 <require
143 permission="launchpad.View"143 permission="launchpad.View"
144 interface="canonical.launchpad.interfaces.IHWDevice" />144 interface="canonical.launchpad.interfaces.IHWDevice" />
@@ -151,24 +151,24 @@
151 />151 />
152152
153 <securedutility153 <securedutility
154 class="canonical.launchpad.database.HWDeviceSet"154 class="canonical.launchpad.database.hwdb.HWDeviceSet"
155 provides="canonical.launchpad.interfaces.IHWDeviceSet">155 provides="canonical.launchpad.interfaces.IHWDeviceSet">
156 <allow interface="canonical.launchpad.interfaces.IHWDeviceSet" />156 <allow interface="canonical.launchpad.interfaces.IHWDeviceSet" />
157 </securedutility>157 </securedutility>
158158
159 <class class="canonical.launchpad.database.HWDeviceNameVariant">159 <class class="canonical.launchpad.database.hwdb.HWDeviceNameVariant">
160 <allow interface=160 <allow interface=
161 "canonical.launchpad.interfaces.IHWDeviceNameVariant" />161 "canonical.launchpad.interfaces.IHWDeviceNameVariant" />
162 </class>162 </class>
163163
164 <securedutility164 <securedutility
165 class="canonical.launchpad.database.HWDeviceNameVariantSet"165 class="canonical.launchpad.database.hwdb.HWDeviceNameVariantSet"
166 provides="canonical.launchpad.interfaces.IHWDeviceNameVariantSet">166 provides="canonical.launchpad.interfaces.IHWDeviceNameVariantSet">
167 <allow interface=167 <allow interface=
168 "canonical.launchpad.interfaces.IHWDeviceNameVariantSet" />168 "canonical.launchpad.interfaces.IHWDeviceNameVariantSet" />
169 </securedutility>169 </securedutility>
170170
171 <class class="canonical.launchpad.database.HWDriver">171 <class class="canonical.launchpad.database.hwdb.HWDriver">
172 <require172 <require
173 permission="launchpad.View"173 permission="launchpad.View"
174 interface="canonical.launchpad.interfaces.IHWDriver" />174 interface="canonical.launchpad.interfaces.IHWDriver" />
@@ -181,13 +181,13 @@
181 />181 />
182182
183 <securedutility183 <securedutility
184 class="canonical.launchpad.database.HWDriverSet"184 class="canonical.launchpad.database.hwdb.HWDriverSet"
185 provides="canonical.launchpad.interfaces.IHWDriverSet">185 provides="canonical.launchpad.interfaces.IHWDriverSet">
186 <allow186 <allow
187 interface="canonical.launchpad.interfaces.IHWDriverSet" />187 interface="canonical.launchpad.interfaces.IHWDriverSet" />
188 </securedutility>188 </securedutility>
189189
190 <class class="canonical.launchpad.database.HWDriverName">190 <class class="canonical.launchpad.database.hwdb.HWDriverName">
191 <require191 <require
192 permission="launchpad.View"192 permission="launchpad.View"
193 interface="canonical.launchpad.interfaces.IHWDriverName" />193 interface="canonical.launchpad.interfaces.IHWDriverName" />
@@ -199,7 +199,7 @@
199 parent_utility="canonical.launchpad.interfaces.IHWDBApplication"199 parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
200 />200 />
201201
202 <class class="canonical.launchpad.database.HWDriverPackageName">202 <class class="canonical.launchpad.database.hwdb.HWDriverPackageName">
203 <require203 <require
204 permission="launchpad.View"204 permission="launchpad.View"
205 interface="canonical.launchpad.interfaces.IHWDriverPackageName" />205 interface="canonical.launchpad.interfaces.IHWDriverPackageName" />
@@ -211,20 +211,20 @@
211 parent_utility="canonical.launchpad.interfaces.IHWDBApplication"211 parent_utility="canonical.launchpad.interfaces.IHWDBApplication"
212 />212 />
213213
214 <class class="canonical.launchpad.database.HWDeviceDriverLink">214 <class class="canonical.launchpad.database.hwdb.HWDeviceDriverLink">
215 <allow215 <allow
216 interface="canonical.launchpad.interfaces.IHWDeviceDriverLink" />216 interface="canonical.launchpad.interfaces.IHWDeviceDriverLink" />
217 <allow attributes="id" />217 <allow attributes="id" />
218 </class>218 </class>
219219
220 <securedutility220 <securedutility
221 class="canonical.launchpad.database.HWDeviceDriverLinkSet"221 class="canonical.launchpad.database.hwdb.HWDeviceDriverLinkSet"
222 provides="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet">222 provides="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet">
223 <allow223 <allow
224 interface="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet" />224 interface="canonical.launchpad.interfaces.IHWDeviceDriverLinkSet" />
225 </securedutility>225 </securedutility>
226226
227 <class class="canonical.launchpad.database.HWDeviceClass">227 <class class="canonical.launchpad.database.hwdb.HWDeviceClass">
228 <require permission="launchpad.View"228 <require permission="launchpad.View"
229 interface="canonical.launchpad.interfaces.IHWDeviceClass" />229 interface="canonical.launchpad.interfaces.IHWDeviceClass" />
230 </class>230 </class>
@@ -242,7 +242,7 @@
242 interface="canonical.launchpad.interfaces.IHWDeviceClassSet" />242 interface="canonical.launchpad.interfaces.IHWDeviceClassSet" />
243 </securedutility>243 </securedutility>
244244
245 <class class="canonical.launchpad.database.HWSubmissionDevice">245 <class class="canonical.launchpad.database.hwdb.HWSubmissionDevice">
246 <require246 <require
247 permission="launchpad.View"247 permission="launchpad.View"
248 interface="canonical.launchpad.interfaces.IHWSubmissionDevice" />248 interface="canonical.launchpad.interfaces.IHWSubmissionDevice" />
@@ -255,20 +255,20 @@
255 />255 />
256256
257 <securedutility257 <securedutility
258 class="canonical.launchpad.database.HWSubmissionDeviceSet"258 class="canonical.launchpad.database.hwdb.HWSubmissionDeviceSet"
259 provides="canonical.launchpad.interfaces.IHWSubmissionDeviceSet">259 provides="canonical.launchpad.interfaces.IHWSubmissionDeviceSet">
260 <allow260 <allow
261 interface="canonical.launchpad.interfaces.IHWSubmissionDeviceSet" />261 interface="canonical.launchpad.interfaces.IHWSubmissionDeviceSet" />
262 </securedutility>262 </securedutility>
263263
264 <class class="canonical.launchpad.database.HWSubmissionBug">264 <class class="canonical.launchpad.database.hwdb.HWSubmissionBug">
265 <allow265 <allow
266 interface="canonical.launchpad.interfaces.IHWSubmissionBug" />266 interface="canonical.launchpad.interfaces.IHWSubmissionBug" />
267 <allow attributes="id" />267 <allow attributes="id" />
268 </class>268 </class>
269269
270 <securedutility270 <securedutility
271 class="canonical.launchpad.database.HWSubmissionBugSet"271 class="canonical.launchpad.database.hwdb.HWSubmissionBugSet"
272 provides="canonical.launchpad.interfaces.IHWSubmissionBugSet">272 provides="canonical.launchpad.interfaces.IHWSubmissionBugSet">
273 <allow273 <allow
274 interface="canonical.launchpad.interfaces.IHWSubmissionBugSet" />274 interface="canonical.launchpad.interfaces.IHWSubmissionBugSet" />
275275
=== modified file 'lib/canonical/launchpad/zcml/launchpadstatistic.zcml'
--- lib/canonical/launchpad/zcml/launchpadstatistic.zcml 2009-09-18 13:24:29 +0000
+++ lib/canonical/launchpad/zcml/launchpadstatistic.zcml 2009-09-29 11:33:15 +0000
@@ -9,14 +9,14 @@
9 i18n_domain="launchpad">9 i18n_domain="launchpad">
1010
11 <!-- LaunchpadStatistic -->11 <!-- LaunchpadStatistic -->
12 <class class="canonical.launchpad.database.LaunchpadStatistic">12 <class class="canonical.launchpad.database.launchpadstatistic.LaunchpadStatistic">
13 <allow interface="canonical.launchpad.interfaces.ILaunchpadStatistic" />13 <allow interface="canonical.launchpad.interfaces.launchpadstatistic.ILaunchpadStatistic" />
14 </class>14 </class>
1515
1616
17 <!-- LaunchpadStatisticSet -->17 <!-- LaunchpadStatisticSet -->
18 <securedutility18 <securedutility
19 class="canonical.launchpad.database.LaunchpadStatisticSet"19 class="canonical.launchpad.database.launchpadstatistic.LaunchpadStatisticSet"
20 provides="canonical.launchpad.interfaces.ILaunchpadStatisticSet">20 provides="canonical.launchpad.interfaces.ILaunchpadStatisticSet">
21 <allow interface="canonical.launchpad.interfaces.ILaunchpadStatisticSet" />21 <allow interface="canonical.launchpad.interfaces.ILaunchpadStatisticSet" />
22 </securedutility>22 </securedutility>
2323
=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
--- lib/lp/code/model/tests/test_branchjob.py 2009-08-13 07:00:48 +0000
+++ lib/lp/code/model/tests/test_branchjob.py 2009-09-29 11:33:15 +0000
@@ -957,6 +957,25 @@
957 entry = entries[0]957 entry = entries[0]
958 self.assertEqual(pot_path, entry.path)958 self.assertEqual(pot_path, entry.path)
959959
960 def test_init_translation_file_lists_skip_dirs(self):
961 # The method _init_translation_file_lists extracts all translation
962 # files from the branch but does not add changed directories to the
963 # template_files_changed and translation_files_changed lists .
964 pot_path = u"subdir/foo.pot"
965 pot_content = self.factory.getUniqueString()
966 po_path = u"subdir/foo.po"
967 po_content = self.factory.getUniqueString()
968 self._makeBranchWithTreeAndFiles(((pot_path, pot_content),
969 (po_path, po_content)))
970 self._makeProductSeries(TranslationsBranchImportMode.NO_IMPORT)
971 job = RosettaUploadJob.create(self.branch, NULL_REVISION, True)
972 job._init_translation_file_lists()
973
974 self.assertEqual([(pot_path, pot_content)],
975 job.template_files_changed)
976 self.assertEqual([(po_path, po_content)],
977 job.translation_files_changed)
978
960 def test_upload_xpi_template(self):979 def test_upload_xpi_template(self):
961 # XPI templates are indentified by a special name. They are imported980 # XPI templates are indentified by a special name. They are imported
962 # like POT files.981 # like POT files.

Subscribers

People subscribed via source and target branches

to status/vote changes: