aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/qt.py
diff options
context:
space:
mode:
authorAleksey Filippov <alekseyf@google.com>2018-01-29 00:10:43 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-30 07:08:22 +1100
commit2cf85ae16f79b5edcbfa34d57b477c984c79e7a5 (patch)
treef0c533465924188dec1a95926ae48b4c63c00309 /mesonbuild/modules/qt.py
parent4e5ad57161a475dfab1c1a4edde075b2620b9f75 (diff)
downloadmeson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.zip
meson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.tar.gz
meson-2cf85ae16f79b5edcbfa34d57b477c984c79e7a5.tar.bz2
Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
Diffstat (limited to 'mesonbuild/modules/qt.py')
-rw-r--r--mesonbuild/modules/qt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 595269e..f5ce1ed 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -73,7 +73,7 @@ class QtBaseModule:
def parse_qrc(self, state, fname):
abspath = os.path.join(state.environment.source_dir, state.subdir, fname)
- relative_part = os.path.split(fname)[0]
+ relative_part = os.path.dirname(fname)
try:
tree = ET.parse(abspath)
root = tree.getroot()
@@ -116,7 +116,7 @@ class QtBaseModule:
sources.append(res_target)
else:
for rcc_file in rcc_files:
- basename = os.path.split(rcc_file)[1]
+ basename = os.path.basename(rcc_file)
name = 'qt' + str(self.qt_version) + '-' + basename.replace('.', '_')
rcc_kwargs = {'input': rcc_file,
'output': name + '.cpp',