summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 11:36:51 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2012-11-14 11:38:57 +0900
commitc1b86a232383748811c6faf17f364e63e10f7dd4 (patch)
tree8f28c8e8a922ffd4165f48a1988500070936bd39 /manifest_xml.py
parent98ffba1401056e2d88d3f3898b6fbf5d7d3931a4 (diff)
downloadgit-repo-c1b86a232383748811c6faf17f364e63e10f7dd4.tar.gz
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
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py44
1 files changed, 22 insertions, 22 deletions
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):
67 # urljoin will get confused if there is no scheme in the base url 67 # urljoin will get confused if there is no scheme in the base url
68 # ie, if manifestUrl is of the form <hostname:port> 68 # ie, if manifestUrl is of the form <hostname:port>
69 if manifestUrl.find(':') != manifestUrl.find('/') - 1: 69 if manifestUrl.find(':') != manifestUrl.find('/') - 1:
70 manifestUrl = 'gopher://' + manifestUrl 70 manifestUrl = 'gopher://' + manifestUrl
71 url = urlparse.urljoin(manifestUrl, url) 71 url = urlparse.urljoin(manifestUrl, url)
72 return re.sub(r'^gopher://', '', url) 72 return re.sub(r'^gopher://', '', url)
73 73
@@ -349,24 +349,24 @@ class XmlManifest(object):
349 nodes = [] 349 nodes = []
350 for node in manifest.childNodes: # pylint:disable=W0631 350 for node in manifest.childNodes: # pylint:disable=W0631
351 # We only get here if manifest is initialised 351 # We only get here if manifest is initialised
352 if node.nodeName == 'include': 352 if node.nodeName == 'include':
353 name = self._reqatt(node, 'name') 353 name = self._reqatt(node, 'name')
354 fp = os.path.join(include_root, name) 354 fp = os.path.join(include_root, name)
355 if not os.path.isfile(fp): 355 if not os.path.isfile(fp):
356 raise ManifestParseError, \ 356 raise ManifestParseError, \
357 "include %s doesn't exist or isn't a file" % \ 357 "include %s doesn't exist or isn't a file" % \
358 (name,) 358 (name,)
359 try: 359 try:
360 nodes.extend(self._ParseManifestXml(fp, include_root)) 360 nodes.extend(self._ParseManifestXml(fp, include_root))
361 # should isolate this to the exact exception, but that's 361 # should isolate this to the exact exception, but that's
362 # tricky. actual parsing implementation may vary. 362 # tricky. actual parsing implementation may vary.
363 except (KeyboardInterrupt, RuntimeError, SystemExit): 363 except (KeyboardInterrupt, RuntimeError, SystemExit):
364 raise 364 raise
365 except Exception as e: 365 except Exception as e:
366 raise ManifestParseError( 366 raise ManifestParseError(
367 "failed parsing included manifest %s: %s", (name, e)) 367 "failed parsing included manifest %s: %s", (name, e))
368 else: 368 else:
369 nodes.append(node) 369 nodes.append(node)
370 return nodes 370 return nodes
371 371
372 def _ParseManifest(self, node_list): 372 def _ParseManifest(self, node_list):
@@ -404,9 +404,9 @@ class XmlManifest(object):
404 if node.nodeName == 'manifest-server': 404 if node.nodeName == 'manifest-server':
405 url = self._reqatt(node, 'url') 405 url = self._reqatt(node, 'url')
406 if self._manifest_server is not None: 406 if self._manifest_server is not None:
407 raise ManifestParseError( 407 raise ManifestParseError(
408 'duplicate manifest-server in %s' % 408 'duplicate manifest-server in %s' %
409 (self.manifestFile)) 409 (self.manifestFile))
410 self._manifest_server = url 410 self._manifest_server = url
411 411
412 for node in itertools.chain(*node_list): 412 for node in itertools.chain(*node_list):