Oops, can't reference a value before it exists

This commit is contained in:
Raoul Snyman 2016-12-06 22:27:46 +02:00
parent 7d98b5ab2a
commit 9425cd40f0
1 changed files with 16 additions and 17 deletions

View File

@ -204,6 +204,17 @@ class Builder(object):
path = os.path.abspath(self.config.get('paths', name))
setattr(self, '{name}_path'.format(name=name), path)
self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path))
# Make any command line options override the config file
if self.args.branch:
self.branch_path = os.path.abspath(self.args.branch)
if self.args.documentation:
self.documentation_path = os.path.abspath(self.args.documentation)
if self.args.release:
self.version = self.args.release
self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version))
else:
self.version = None
self.work_path = self.branch_path
self.openlp_script = os.path.abspath(os.path.join(self.work_path, 'openlp-run.py'))
self.source_path = os.path.join(self.work_path, 'openlp')
self.manual_path = os.path.join(self.documentation_path, 'manual')
@ -211,6 +222,7 @@ class Builder(object):
self.i18n_utils = os.path.join(self.work_path, 'scripts', 'translation_utils.py')
self.i18n_path = os.path.join(self.work_path, 'resources', 'i18n')
self.build_path = os.path.join(self.work_path, 'build')
# Print out all the values
self._print_verbose(' {:.<20} {}'.format('openlp script: ', self.openlp_script))
self._print_verbose(' {:.<20} {}'.format('source: ', self.source_path))
self._print_verbose(' {:.<20} {}'.format('manual path: ', self.manual_path))
@ -218,24 +230,11 @@ class Builder(object):
self._print_verbose(' {:.<20} {}'.format('i18n utils: ', self.i18n_utils))
self._print_verbose(' {:.<20} {}'.format('i18n path: ', self.i18n_path))
self._print_verbose(' {:.<20} {}'.format('build path: ', self.build_path))
# Make any command line options override the config file
self._print_verbose('Overrides:')
if self.args.branch:
self.branch_path = os.path.abspath(self.args.branch)
self._print_verbose(' {:.<20} {}'.format('branch **: ', self.branch_path))
if self.args.documentation:
self.documentation_path = os.path.abspath(self.args.documentation)
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.branch_path))
if self.args.release:
self.version = self.args.release
self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version))
self._print_verbose(' {:.<20} {}'.format('release: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
else:
self.version = None
self.work_path = self.branch_path
self._print_verbose(' {:.<20} {}'.format('version: ', 'bzr'))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
self._print_verbose(' {:.<20} {}'.format('branch **: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('version: ', self.version))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
def setup_extra(self):
"""