diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2023-10-20 23:29:42 +0545 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-10-21 00:55:01 +0000 |
commit | 0bcffd865616a0a14b7e9f2b03d77da2444d3025 (patch) | |
tree | ef325cc1740f5b48b157eff1cbcb11b0fe2d43b9 /manifest_xml.py | |
parent | 7393f6bc414ae5d140101fffcb48148a36b80f64 (diff) | |
download | git-repo-0bcffd865616a0a14b7e9f2b03d77da2444d3025.tar.gz |
cleanup: use new dict & set generator styles
Change-Id: Ie34ac33ada7855945c77238da3ce644f8a9f8306
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390374
Tested-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 0068ac6a..97baed57 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -727,10 +727,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
727 | self._output_manifest_project_extras(p, e) | 727 | self._output_manifest_project_extras(p, e) |
728 | 728 | ||
729 | if p.subprojects: | 729 | if p.subprojects: |
730 | subprojects = set(subp.name for subp in p.subprojects) | 730 | subprojects = {subp.name for subp in p.subprojects} |
731 | output_projects(p, e, list(sorted(subprojects))) | 731 | output_projects(p, e, list(sorted(subprojects))) |
732 | 732 | ||
733 | projects = set(p.name for p in self._paths.values() if not p.parent) | 733 | projects = {p.name for p in self._paths.values() if not p.parent} |
734 | output_projects(None, root, list(sorted(projects))) | 734 | output_projects(None, root, list(sorted(projects))) |
735 | 735 | ||
736 | if self._repo_hooks_project: | 736 | if self._repo_hooks_project: |
@@ -800,10 +800,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
800 | for child in node.childNodes: | 800 | for child in node.childNodes: |
801 | if child.nodeType == xml.dom.Node.ELEMENT_NODE: | 801 | if child.nodeType == xml.dom.Node.ELEMENT_NODE: |
802 | attrs = child.attributes | 802 | attrs = child.attributes |
803 | element = dict( | 803 | element = { |
804 | (attrs.item(i).localName, attrs.item(i).value) | 804 | attrs.item(i).localName: attrs.item(i).value |
805 | for i in range(attrs.length) | 805 | for i in range(attrs.length) |
806 | ) | 806 | } |
807 | if child.nodeName in SINGLE_ELEMENTS: | 807 | if child.nodeName in SINGLE_ELEMENTS: |
808 | ret[child.nodeName] = element | 808 | ret[child.nodeName] = element |
809 | elif child.nodeName in MULTI_ELEMENTS: | 809 | elif child.nodeName in MULTI_ELEMENTS: |
@@ -985,7 +985,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
985 | @property | 985 | @property |
986 | def PartialCloneExclude(self): | 986 | def PartialCloneExclude(self): |
987 | exclude = self.manifest.manifestProject.partial_clone_exclude or "" | 987 | exclude = self.manifest.manifestProject.partial_clone_exclude or "" |
988 | return set(x.strip() for x in exclude.split(",")) | 988 | return {x.strip() for x in exclude.split(",")} |
989 | 989 | ||
990 | def SetManifestOverride(self, path): | 990 | def SetManifestOverride(self, path): |
991 | """Override manifestFile. The caller must call Unload()""" | 991 | """Override manifestFile. The caller must call Unload()""" |