From 6cea397a95dab91ebf37f25e443393c22da065f7 Mon Sep 17 00:00:00 2001 From: Justn Lavoie Date: Thu, 29 Dec 2016 19:49:27 -0500 Subject: tdf#97361 Use join() for string concatenation The PEP8 suggest to use join() instead of + operator for string concatenation. Change-Id: I35325cc73845a450f5c8ce40b7594e6d57ad6f45 Reviewed-on: https://gerrit.libreoffice.org/32504 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- sw/qa/python/load_save_test.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'sw') diff --git a/sw/qa/python/load_save_test.py b/sw/qa/python/load_save_test.py index 527184e3d3e0..a79bc3285af0 100644 --- a/sw/qa/python/load_save_test.py +++ b/sw/qa/python/load_save_test.py @@ -73,20 +73,17 @@ class LoadSaveTest(unittest.TestCase): filepath = os.path.abspath("FIXME") if os.name == "nt": - source_file = "file:///" + filepath + "/" + quote(self.file_name) + source_file = ''.join(("file:///", filepath, "/", quote(self.file_name))) else: - source_file = "file://" + quote(filepath) + "/" + quote(self.file_name) + source_file = ''.join(("file://", quote(filepath), "/", quote(self.file_name))) + self.xDoc = desktop.loadComponentFromURL(source_file, "_blank", 0, load_props) assert(self.xDoc) if os.name == "nt": - target_file = "file:///" + self.m_TargetDir + quote(self.m_SourceDir) + "/" + quote(self.file_name) + target_file = ''.join(("file:///", self.m_TargetDir, quote(self.m_SourceDir), "/", quote(self.file_name))) else: - target_file = "file://" + - quote(self.m_TargetDir) + - quote(self.m_SourceDir) + - "/" + - quote(self.fileName) + target_file = ''.join(("file://", quote(self.m_TargetDir), quote(self.m_SourceDir), "/", quote(self.fileName))) p1 = PropertyValue() PropValue = uno.Any("[]com.sun.star.beans.PropertyValue", (p1,)) @@ -98,7 +95,8 @@ class LoadSaveTest(unittest.TestCase): def getDirAndFile(self, dir): root2 = os.mkdir(dir) - root = open(dir + "/" + dir + ".odt", 'a') + root_path = ''.join((dir, "/", dir, ".odt")) + root = open(root_path, 'a') self.getDirAndFileNames(dir) return self.dirs, self.files @@ -129,5 +127,6 @@ class LoadSaveTest(unittest.TestCase): f = os.mkdir(target + dir) self.assertTrue(os.path.exists(target + dir)) - root = open(target + dir + "/" + self.m_SourceDir + ".odt", 'a') - filepath = os.path.abspath(target + dir + "/" + self.m_SourceDir + ".odt") + target_path = ''.join((target, dir, "/", self.m_SourceDir, ".odt")) + root = open(target_path, 'a') + filepath = os.path.abspath(target_path) -- cgit