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
diff --git a/manifest_xml.py b/manifest_xml.py
index bb93bca..1b95456 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -67,7 +67,7 @@
# urljoin will get confused if there is no scheme in the base url
# ie, if manifestUrl is of the form <hostname:port>
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 @@
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 @@
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):