From 0861f870a3bd1682f5a21a717e262e2d34bf0b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 24 May 2013 23:43:49 +0200 Subject: [PATCH] More os.path.join() use cases --- fdroidserver/checkupdates.py | 2 +- fdroidserver/common.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 0a855327..713ad6bd 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -73,7 +73,7 @@ def check_tags(app, sdk_path): vcs.gotorevision(tag) # Only process tags where the manifest exists... - if os.path.exists(build_dir + '/AndroidManifest.xml'): + if os.path.exists(os.path.join(build_dir, 'AndroidManifest.xml')): version, vercode, package = common.parse_androidmanifest(build_dir) if package and package == app['id'] and version and vercode: if int(vercode) > int(hcode): diff --git a/fdroidserver/common.py b/fdroidserver/common.py index afa74220..ec9d7a98 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -257,7 +257,7 @@ class vcs_gitsvn(vcs): def gettags(self): self.checkrepo() - return os.listdir(self.local+'/.git/svn/refs/remotes/tags') + return os.listdir(os.path.join(self.local, '/.git/svn/refs/remotes/tags')) class vcs_svn(vcs): @@ -850,7 +850,7 @@ def parse_androidmanifest(app_dir): version = None vercode = None package = None - for line in file(app_dir + '/AndroidManifest.xml'): + for line in file(os.path.join(app_dir, 'AndroidManifest.xml')): if not package: matches = psearch(line) if matches: @@ -865,14 +865,15 @@ def parse_androidmanifest(app_dir): vercode = matches.group(1) if version: return (version, vercode, package) - for xmlfile in glob.glob(app_dir + '/res/values/strings*transl*.xml'): + for xmlfile in glob.glob(os.path.join( + app_dir, 'res', 'values', 'strings*transl*.xml')): for line in file(xmlfile): if not version: matches = vnsearch_xml(line) if matches: version = matches.group(2) if not version: - for line in file(app_dir + '/res/values/strings.xml'): + for line in file(os.path.join(app_dir, 'res/values/strings.xml')): if not version: matches = vnsearch_xml(line) if matches: @@ -1088,7 +1089,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path, print 'Force-removing old build.xml' os.remove(buildxml) for d in update_dirs: - cwd = root_dir + '/' + d + cwd = os.path.join(root_dir, d) if verbose: print "Update of '%s': exec '%s' in '%s'"%\ (d," ".join(parms),cwd)