From c1b86a232383748811c6faf17f364e63e10f7dd4 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 14 Nov 2012 11:36:51 +0900 Subject: Fix inconsistent indentation The repo coding style is to indent at 2 characters, but there are many places where this is not followed. Enable pylint warning "W0311: Bad indentation" and make sure all indentation is at multiples of 2 characters. Change-Id: I68f0f64470789ce2429ab11104d15d380a63e6a8 --- manifest_xml.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index bb93bca3..1b954561 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -67,7 +67,7 @@ class _XmlRemote(object): # urljoin will get confused if there is no scheme in the base url # ie, if manifestUrl is of the form if manifestUrl.find(':') != manifestUrl.find('/') - 1: - manifestUrl = 'gopher://' + manifestUrl + manifestUrl = 'gopher://' + manifestUrl url = urlparse.urljoin(manifestUrl, url) return re.sub(r'^gopher://', '', url) @@ -349,24 +349,24 @@ class XmlManifest(object): nodes = [] for node in manifest.childNodes: # pylint:disable=W0631 # We only get here if manifest is initialised - if node.nodeName == 'include': - name = self._reqatt(node, 'name') - fp = os.path.join(include_root, name) - if not os.path.isfile(fp): - raise ManifestParseError, \ - "include %s doesn't exist or isn't a file" % \ - (name,) - try: - nodes.extend(self._ParseManifestXml(fp, include_root)) - # should isolate this to the exact exception, but that's - # tricky. actual parsing implementation may vary. - except (KeyboardInterrupt, RuntimeError, SystemExit): - raise - except Exception as e: - raise ManifestParseError( - "failed parsing included manifest %s: %s", (name, e)) - else: - nodes.append(node) + if node.nodeName == 'include': + name = self._reqatt(node, 'name') + fp = os.path.join(include_root, name) + if not os.path.isfile(fp): + raise ManifestParseError, \ + "include %s doesn't exist or isn't a file" % \ + (name,) + try: + nodes.extend(self._ParseManifestXml(fp, include_root)) + # should isolate this to the exact exception, but that's + # tricky. actual parsing implementation may vary. + except (KeyboardInterrupt, RuntimeError, SystemExit): + raise + except Exception as e: + raise ManifestParseError( + "failed parsing included manifest %s: %s", (name, e)) + else: + nodes.append(node) return nodes def _ParseManifest(self, node_list): @@ -404,9 +404,9 @@ class XmlManifest(object): if node.nodeName == 'manifest-server': url = self._reqatt(node, 'url') if self._manifest_server is not None: - raise ManifestParseError( - 'duplicate manifest-server in %s' % - (self.manifestFile)) + raise ManifestParseError( + 'duplicate manifest-server in %s' % + (self.manifestFile)) self._manifest_server = url for node in itertools.chain(*node_list): -- cgit v1.2.3-54-g00ecf