summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-06 14:35:11 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-06 14:35:11 +0000
commita4b751181d40d3aca6cdb6e7b78b88bc4428fad0 (patch)
tree9a941ec541457590f637e48fc27cbadfaa26a932
parent4ed178367c727b3a3b34c35dc34c461b2d0ff45d (diff)
downloadmorph-a4b751181d40d3aca6cdb6e7b78b88bc4428fad0.tar.gz
give Builder class the cliapp.Application as argument
This is simpler than giving each separate little thing we need from there.
-rwxr-xr-xmorph2
-rw-r--r--morphlib/builder.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/morph b/morph
index 96987fa8..e814eb7f 100755
--- a/morph
+++ b/morph
@@ -56,7 +56,7 @@ class Morph(cliapp.Application):
def cmd_build(self, args):
tempdir = morphlib.tempdir.Tempdir()
- builder = morphlib.builder.Builder(tempdir, self.msg, self.settings)
+ builder = morphlib.builder.Builder(tempdir, self)
if not os.path.exists(self.settings['cachedir']) and os.getuid() != 0:
os.mkdir(self.settings['cachedir'])
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 0323cbbc..cf06519f 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -372,11 +372,12 @@ class Builder(object):
The objects may be chunks or strata.'''
- def __init__(self, tempdir, msg, settings):
+ def __init__(self, tempdir, app):
self.tempdir = tempdir
- self.real_msg = msg
- self.settings = settings
- self.cachedir = morphlib.cachedir.CacheDir(settings['cachedir'])
+ self.real_msg = app.msg
+ self.settings = app.settings
+ self.dump_memory_profile = app.dump_memory_profile
+ self.cachedir = morphlib.cachedir.CacheDir(self.settings['cachedir'])
self.indent = 0
def msg(self, text):