From 292606ba38ac7007426c4409cc5ca4373a7fd22a Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Sat, 23 Apr 2016 14:38:43 -0700 Subject: [PATCH] Fix translate() string format and some missed conversions --- openlp/core/__init__.py | 4 ++-- openlp/core/common/__init__.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 5ed016309..68dd772be 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -223,8 +223,8 @@ class OpenLP(OpenLPMixin, QtWidgets.QApplication): translate('OpenLP', 'Backup of the data folder failed!')) return message = translate('OpenLP', - 'A backup of the data folder has been created' - 'at {text}'.format(text=data_folder_backup_path)) + 'A backup of the data folder has been created ' + 'at {text}').format(text=data_folder_backup_path) QtWidgets.QMessageBox.information(None, translate('OpenLP', 'Backup'), message) # Update the version in the settings diff --git a/openlp/core/common/__init__.py b/openlp/core/common/__init__.py index 1f5ca0c30..3946ee0b0 100644 --- a/openlp/core/common/__init__.py +++ b/openlp/core/common/__init__.py @@ -286,7 +286,7 @@ def get_uno_command(connection_type='pipe'): CONNECTION = '"--accept=pipe,name=openlp_pipe;urp;"' else: CONNECTION = '"--accept=socket,host=localhost,port=2002;urp;"' - return '%s %s %s' % (command, OPTIONS, CONNECTION) + return '{cmd} {opt} {conn}'.format(cmd=command, opt=OPTIONS, conn=CONNECTION) def get_uno_instance(resolver, connection_type='pipe'): @@ -336,7 +336,7 @@ def delete_file(file_path_name): os.remove(file_path_name) return True except (IOError, OSError): - log.exception("Unable to delete file %s" % file_path_name) + log.exception("Unable to delete file {name}".format(name=file_path_name)) return False @@ -390,7 +390,7 @@ def check_binary_exists(program_path): :param program_path:The full path to the binary to check. :return: program output to be parsed """ - log.debug('testing program_path: %s', program_path) + log.debug('testing program_path: {text}'.format(text=program_path)) try: # Setup startupinfo options for check_output to avoid console popping up on windows if is_win(): @@ -404,5 +404,5 @@ def check_binary_exists(program_path): except Exception: trace_error_handler(log) runlog = '' - log.debug('check_output returned: %s' % runlog) + log.debug('check_output returned: {text}'.format(text=runlog)) return runlog