Commit 4211c7c6 authored by Lucas Carvalho's avatar Lucas Carvalho

Simplified the code...

To avoid the explosion of "if" structure, it is better replace it using
a "for" structure.

The behavior of the code still the same.
parent 25c34da5
...@@ -90,23 +90,14 @@ class Software(object): ...@@ -90,23 +90,14 @@ class Software(object):
self.upload_cache_url or self.upload_dir_url or \ self.upload_cache_url or self.upload_dir_url or \
self.upload_authentication_file is not None: self.upload_authentication_file is not None:
buildout_parameter_list.append('buildout:networkcache-section=networkcache') buildout_parameter_list.append('buildout:networkcache-section=networkcache')
for buildout_option, value in (
if self.signature_private_key_file is not None: ('%ssignature-private-key-file=%s', self.signature_private_key_file),
buildout_parameter_list.append( \ ('%supload-cache-url=%s', self.upload_cache_url),
'networkcache:signature-private-key-file=%s' % \ ('%supload-dir-url=%s', self.upload_dir_url),
self.signature_private_key_file) ('%supload-authentication-file=%s', self.upload_authentication_file)):
if self.upload_cache_url is not None: if value:
buildout_parameter_list.append( \
'networkcache:upload-cache-url=%s' % \
self.upload_cache_url)
if self.upload_dir_url is not None:
buildout_parameter_list.append( \
'networkcache:upload-dir-url=%s' % \
self.upload_dir_url)
if self.upload_authentication_file is not None:
buildout_parameter_list.append( \ buildout_parameter_list.append( \
'networkcache:upload-authentication-file=%s' % \ buildout_option % ('networkcache:', value))
self.upload_authentication_file)
buildout_parameter_list.extend(['-c', self.url]) buildout_parameter_list.extend(['-c', self.url])
bootstrapBuildout(self.software_path, self.buildout, bootstrapBuildout(self.software_path, self.buildout,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment