Only perform a debug PyInstaller build if the '--debug' flag is set

This commit is contained in:
Raoul Snyman 2016-12-15 17:20:00 +02:00
parent c5654e4256
commit eece48fb3d
1 changed files with 6 additions and 5 deletions

View File

@ -159,6 +159,7 @@ class Builder(object):
help='Do NOT update the branch before building')
parser.add_argument('--skip-translations', action='store_true', default=False,
help='Do NOT update the language translation files')
parser.add_argument('--debug', action='store_true', default=False, help='Create a debug build')
self.add_extra_args(parser)
self.args = parser.parse_args()
@ -232,7 +233,7 @@ class Builder(object):
self._print_verbose(' {:.<20} {}'.format('build path: ', self.build_path))
self._print_verbose('Overrides:')
self._print_verbose(' {:.<20} {}'.format('branch **: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.documentation_path))
self._print_verbose(' {:.<20} {}'.format('version: ', self.version))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
@ -279,11 +280,11 @@ class Builder(object):
'-i', self.icon_path,
'-n', 'OpenLP',
self.openlp_script]
if not self.args.verbose:
cmd.append('--log-level=ERROR')
else:
if self.args.verbose:
cmd.append('--log-level=DEBUG')
if not self.args.release:
else:
cmd.append('--log-level=ERROR')
if self.args.debug:
cmd.append('-d')
self._print_verbose('... {}'.format(' '.join(cmd)))
output, error = self._run_command(cmd, 'Error running PyInstaller')