summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustn Lavoie <jlavoie1602@gmail.com>2016-12-29 19:49:27 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-03 00:02:09 +0000
commit6cea397a95dab91ebf37f25e443393c22da065f7 (patch)
tree353eb551efc159f15575eddbb9e233fd21c5d00d /sw
parent215cbfb460326010737433c2020638e9388a88a4 (diff)
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 <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/python/load_save_test.py21
1 files changed, 10 insertions, 11 deletions
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)