1
0
mirror of https://gitlab.com/openlp/packaging.git synced 2024-12-22 13:02:50 +00:00

Fix up some messages, make some messages only show in verbose mode, and add some more logging for debugging

This commit is contained in:
Raoul Snyman 2016-12-09 11:52:33 +02:00
parent 2a52c24fa3
commit 4ad35f87c5
2 changed files with 12 additions and 11 deletions

View File

@ -417,7 +417,7 @@ class Builder(object):
Run Sphinx to build the manual
"""
self._print('Running Sphinx...')
self._print_verbose(' Deleting previous help manual build... %s', self.manual_build_path)
self._print_verbose('... Deleting previous help manual build... %s', self.manual_build_path)
if os.path.exists(self.manual_build_path):
rmtree(self.manual_build_path)
os.chdir(self.manual_path)

View File

@ -166,7 +166,7 @@ class WindowsBuilder(Builder):
Checks the PortableApp directory structure amd creates
missing subdirs
"""
self._print(' Checking PortableApps directory structure...')
self._print('... Checking PortableApps directory structure...')
launcher_path = os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'Launcher')
if not os.path.exists(launcher_path):
os.makedirs(launcher_path)
@ -178,7 +178,7 @@ class WindowsBuilder(Builder):
"""
Create a Portabbleapps appinfo.ini file.
"""
self._print(' Creating PortableApps appinfo file ...')
self._print_verbose('... Creating PortableApps appinfo file ...')
config_dir = os.path.dirname(self.config_path)
self.portable_version = self.version.replace('-bzr', '.')
self.portable_version = self.portable_version + '.0' * (3 - self.portable_version.count('.'))
@ -197,39 +197,40 @@ class WindowsBuilder(Builder):
3 Builds the PortableApps Install
"""
self._print('Running PortableApps Builder...')
self._print(' Clearing old files')
self._print_verbose('... Clearing old files')
# Remove previous contents of portableapp build directory.
if os.path.exists(self.portable_dest_path):
rmtree(self.portable_dest_path)
self._print(' Creating PortableApps build directory')
self._print_verbose('... Creating PortableApps build directory')
# Copy the contents of the OpenLPPortable directory to the portable
# build directory.
dir_util.copy_tree(self.portable_source_path, self.portable_dest_path)
self._create_portableapp_structure()
self._create_portableapps_appinfo_file()
# Copy distribution files to portableapp build directory.
self._print(' Copying distribution files')
self._print_verbose('... Copying distribution files')
portable_app_path = os.path.join(self.portable_dest_path, 'App', 'OpenLP')
dir_util.copy_tree(self.dist_path, portable_app_path)
# Copy help files to portableapp build directory.
if os.path.isfile(os.path.join(self.helpfile_path, 'OpenLP.chm')):
self._print(' Copying help files')
self._print_verbose('... Copying help files')
dir_util.copy_tree(self.helpfile_path, os.path.join(portable_app_path, 'help'))
else:
self._print('... WARNING: Windows help file not found')
# Build the launcher.
self._print(' Building PortableApps Launcher')
self._print_verbose('... Building PortableApps Launcher')
self._run_command([self.portablelauncher_exe, self.portable_dest_path],
'Error creating PortableAppa Launcher')
'Error creating PortableApps Launcher')
# Build the portable installer.
self._print(' Building PortableApps Installer')
self._print_verbose('... Building PortableApps Installer')
self._run_command([self.portableinstaller_exe, self.portable_dest_path],
'Error running PortableApps Installer')
portable_app = os.path.abspath(os.path.join(self.portable_dest_path, '..',
'OpenLPPortable_%s.paf.exe' % self.portable_version))
self._print_verbose('... Portable Build: {}'.format(portable_app))
if os.path.exists(portable_app):
move(portable_app, os.path.abspath(os.path.join(self.dist_path, '..')))
self._print(' PortableApp build complete')
self._print('PortableApp build complete')
else:
raise Exception('PortableApp failed to build')