diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-10-05 20:33:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-10-05 20:33:43 +0100 |
| commit | 8a15fb559482439412f854f97fd986a75380d710 (patch) | |
| tree | 2311e3fd1cd9a0aadbc9287d153622280a16741c | |
| parent | a9661d80dfb96ea6c6bd94b17feffc5968225412 (diff) | |
| parent | 3a47d15afbd227a61dca0f5d311f6eafa71ea8d1 (diff) | |
Merge branch 'master' of git.carlh.net:git/cdist
| -rwxr-xr-x | cdist | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -43,9 +43,9 @@ class Error(Exception): # class Option(object): - def __init__(self, key): + def __init__(self, key, default=None): self.key = key - self.value = None + self.value = default def offer(self, key, value): if key == self.key: @@ -69,7 +69,8 @@ class Config: Option('osx_build_host'), Option('osx_environment_prefix'), Option('osx_sdk_prefix'), - Option('osx_sdk') ] + Option('osx_sdk'), + Option('parallel', 4) ] try: f = open('%s/.config/cdist' % os.path.expanduser('~'), 'r') @@ -203,9 +204,9 @@ class Version: class Target(object): # @param directory directory to work in; if None we will use a temporary directory # Temporary directories will be removed after use; specified directories will not - def __init__(self, platform, parallel, directory=None): + def __init__(self, platform, directory=None): self.platform = platform - self.parallel = parallel + self.parallel = int(config.get('parallel')) if directory is None: self.directory = tempfile.mkdtemp('', 'tmp', TEMPORARY_DIRECTORY) @@ -293,7 +294,7 @@ class Target(object): class WindowsTarget(Target): def __init__(self, bits, directory=None): - super(WindowsTarget, self).__init__('windows', 2, directory) + super(WindowsTarget, self).__init__('windows', directory) self.bits = bits self.windows_prefix = '%s/%d' % (config.get('windows_environment_prefix'), self.bits) @@ -335,7 +336,7 @@ class WindowsTarget(Target): class LinuxTarget(Target): def __init__(self, distro, version, bits, directory=None): - super(LinuxTarget, self).__init__('linux', 2, directory) + super(LinuxTarget, self).__init__('linux', directory) self.distro = distro self.version = version self.bits = bits @@ -358,7 +359,7 @@ class LinuxTarget(Target): class OSXTarget(Target): def __init__(self, directory=None): - super(OSXTarget, self).__init__('osx', 4, directory) + super(OSXTarget, self).__init__('osx', directory) def command(self, c): command('%s %s' % (self.variables_string(False), c)) @@ -412,7 +413,7 @@ class OSXUniversalTarget(OSXTarget): class SourceTarget(Target): def __init__(self): - super(SourceTarget, self).__init__('source', 2) + super(SourceTarget, self).__init__('source') def command(self, c): log('host -> %s' % c) |
