summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-06-14 16:04:22 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-06-14 16:04:22 +0000
commitd9c8acc730ecc7ea203fb0950a7f461f2822ef4f (patch)
tree520deaa521f5d3ea71f591e273f4e27a802c7788
parente5ce2f18d589b595682044589f4f5527e5b1bee6 (diff)
downloadmorph-d9c8acc730ecc7ea203fb0950a7f461f2822ef4f.tar.gz
fix tabs and line widths so ./check passes
-rw-r--r--morphlib/builder2.py22
-rwxr-xr-xscripts/assemble-stratum12
-rwxr-xr-xscripts/list-overlaps10
3 files changed, 22 insertions, 22 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index e0e1ca57..4191c32a 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -76,8 +76,8 @@ def download_depends(constituents, lac, rac, metadatas=None):
src = rac.get_artifact_metadata(constituent, metadata)
dst = lac.put_artifact_metadata(constituent, metadata)
shutil.copyfileobj(src, dst)
- dst.close()
- src.close()
+ dst.close()
+ src.close()
def get_chunk_files(f): # pragma: no cover
tar = tarfile.open(fileobj=f)
@@ -386,8 +386,8 @@ class StratumBuilder(BuilderBase):
constituents = [dependency
for dependency in self.artifact.dependencies
if dependency.source.morphology['kind'] == 'chunk']
- # the only reason the StratumBuilder has to download chunks is to check
- # for overlap now that strata are lists of chunks
+ # the only reason the StratumBuilder has to download chunks is to
+ # check for overlap now that strata are lists of chunks
with self.build_watch('check-chunks'):
# download the chunk artifact if necessary
download_depends(constituents,
@@ -554,13 +554,13 @@ class SystemBuilder(BuilderBase): # pragma: no cover
chunk_handle.close()
f.close()
meta = self.local_artifact_cache.get_artifact_metadata(
- stratum_artifact, 'meta')
- dst = morphlib.savefile.SaveFile(
- os.path.join(path, 'baserock',
- '%s.meta' % stratum_artifact.name), 'w')
- shutil.copyfileobj(meta, dst)
- dst.close()
- meta.close()
+ stratum_artifact, 'meta')
+ dst = morphlib.savefile.SaveFile(
+ os.path.join(path, 'baserock',
+ '%s.meta' % stratum_artifact.name), 'w')
+ shutil.copyfileobj(meta, dst)
+ dst.close()
+ meta.close()
ldconfig(self.app.runcmd, path)
diff --git a/scripts/assemble-stratum b/scripts/assemble-stratum
index 1fe9bd12..ef81c7f6 100755
--- a/scripts/assemble-stratum
+++ b/scripts/assemble-stratum
@@ -35,15 +35,15 @@ class AssembleStratum(cliapp.Application):
def process_args(self, args):
chunklist = json.load(open(args[0]))
- tarformat = 'w'
+ tarformat = 'w'
if self.settings['tarformat'] != "":
tarformat += self.settings['tarformat']
- outfile = tarfile.open(args[1], tarformat)
- # concatenate chunk tarballs
+ outfile = tarfile.open(args[1], tarformat)
+ # concatenate chunk tarballs
for chunk in chunklist:
path = os.path.join(self.settings['cachedir'], 'artifacts', chunk)
- chunktar = tarfile.open(path, mode='r:*')
- for tarinfo in chunktar:
+ chunktar = tarfile.open(path, mode='r:*')
+ for tarinfo in chunktar:
if tarinfo.isfile():
outfile.addfile(tarinfo, chunktar.extractfile(tarinfo))
else:
@@ -53,6 +53,6 @@ class AssembleStratum(cliapp.Application):
if os.path.exists(args[0] + '.meta'):
outfile.add(args[0] + '.meta',
os.path.join('baserock', '%s.meta' % args[2]))
- outfile.close()
+ outfile.close()
AssembleStratum().run()
diff --git a/scripts/list-overlaps b/scripts/list-overlaps
index 5bd96832..3d92d4ad 100755
--- a/scripts/list-overlaps
+++ b/scripts/list-overlaps
@@ -27,18 +27,18 @@ class ListOverlaps(cliapp.Application):
@staticmethod
def _load_overlap(filename):
data = json.load(open(filename))
- overlaps = dict((frozenset(pair[0]), set(pair[1])) for pair in data)
- return overlaps
+ overlaps = dict((frozenset(pair[0]), set(pair[1])) for pair in data)
+ return overlaps
def cmd_groups(self, args):
overlaps = ListOverlaps._load_overlap(args[0])
- for group in overlaps:
+ for group in overlaps:
print(' '.join(sorted(group)))
def cmd_list_files(self, args):
overlaps = self._load_overlap(args[0])
- group = frozenset(args[1:])
- for filename in overlaps[group]:
+ group = frozenset(args[1:])
+ for filename in overlaps[group]:
print filename
ListOverlaps().run()