diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index a250382f..9b804da9 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -203,6 +203,13 @@ class XmlManifest(object): | |||
| 203 | if p.groups: | 203 | if p.groups: |
| 204 | e.setAttribute('groups', ','.join(p.groups)) | 204 | e.setAttribute('groups', ','.join(p.groups)) |
| 205 | 205 | ||
| 206 | for a in p.annotations: | ||
| 207 | if a.keep == "true": | ||
| 208 | ae = doc.createElement('annotation') | ||
| 209 | ae.setAttribute('name', a.name) | ||
| 210 | ae.setAttribute('value', a.value) | ||
| 211 | e.appendChild(ae) | ||
| 212 | |||
| 206 | if self._repo_hooks_project: | 213 | if self._repo_hooks_project: |
| 207 | root.appendChild(doc.createTextNode('')) | 214 | root.appendChild(doc.createTextNode('')) |
| 208 | e = doc.createElement('repo-hooks') | 215 | e = doc.createElement('repo-hooks') |
| @@ -545,6 +552,8 @@ class XmlManifest(object): | |||
| 545 | for n in node.childNodes: | 552 | for n in node.childNodes: |
| 546 | if n.nodeName == 'copyfile': | 553 | if n.nodeName == 'copyfile': |
| 547 | self._ParseCopyFile(project, n) | 554 | self._ParseCopyFile(project, n) |
| 555 | if n.nodeName == 'annotation': | ||
| 556 | self._ParseAnnotation(project, n) | ||
| 548 | 557 | ||
| 549 | return project | 558 | return project |
| 550 | 559 | ||
| @@ -556,6 +565,17 @@ class XmlManifest(object): | |||
| 556 | # dest is relative to the top of the tree | 565 | # dest is relative to the top of the tree |
| 557 | project.AddCopyFile(src, dest, os.path.join(self.topdir, dest)) | 566 | project.AddCopyFile(src, dest, os.path.join(self.topdir, dest)) |
| 558 | 567 | ||
| 568 | def _ParseAnnotation(self, project, node): | ||
| 569 | name = self._reqatt(node, 'name') | ||
| 570 | value = self._reqatt(node, 'value') | ||
| 571 | try: | ||
| 572 | keep = self._reqatt(node, 'keep').lower() | ||
| 573 | except ManifestParseError: | ||
| 574 | keep = "true" | ||
| 575 | if keep != "true" and keep != "false": | ||
| 576 | raise ManifestParseError, "optional \"keep\" attribute must be \"true\" or \"false\"" | ||
| 577 | project.AddAnnotation(name, value, keep) | ||
| 578 | |||
| 559 | def _get_remote(self, node): | 579 | def _get_remote(self, node): |
| 560 | name = node.getAttribute('remote') | 580 | name = node.getAttribute('remote') |
| 561 | if not name: | 581 | if not name: |
