Skip to content
Snippets Groups Projects
Commit 7c1d23b6 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Python: small fixes

parent 953a6e13
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ class DCTGit(object): ...@@ -53,7 +53,7 @@ class DCTGit(object):
return value[:-1] return value[:-1]
def __init__(self, repo_dir = ""): def __init__(self, repo_dir = ""):
if repo_dir is "": if repo_dir == "":
repo_dir = os.path.join(os.getcwd(), "dct") repo_dir = os.path.join(os.getcwd(), "dct")
self.repo_dir = repo_dir self.repo_dir = repo_dir
...@@ -69,7 +69,7 @@ class DCTGit(object): ...@@ -69,7 +69,7 @@ class DCTGit(object):
# parent_dir = os.path.abspath(os.path.join(dest_dir, os.path.pardir)) # parent_dir = os.path.abspath(os.path.join(dest_dir, os.path.pardir))
# os.chdir(parent_dir) # os.chdir(parent_dir)
if branch is not "": if not branch == "":
cmd = "%s -b %s" % (cmd, branch) cmd = "%s -b %s" % (cmd, branch)
cmd = shlex.split(cmd) cmd = shlex.split(cmd)
...@@ -84,7 +84,7 @@ class DCTGit(object): ...@@ -84,7 +84,7 @@ class DCTGit(object):
return self._cloneRepo(cmd, dest_dir, branch) return self._cloneRepo(cmd, dest_dir, branch)
def updateRepo(self, repo_dir = ""): def updateRepo(self, repo_dir = ""):
if repo_dir is not "": if not repo_dir == "":
self.repo_dir = repo_dir self.repo_dir = repo_dir
currentDir = os.getcwd() currentDir = os.getcwd()
...@@ -106,7 +106,7 @@ class DCTGit(object): ...@@ -106,7 +106,7 @@ class DCTGit(object):
cmd = ["git", "config", "--global", conf_path, value] cmd = ["git", "config", "--global", conf_path, value]
subobj = subprocess.Popen(cmd, stderr = subprocess.PIPE) subobj = subprocess.Popen(cmd, stderr = subprocess.PIPE)
if subobj.wait() is not 0: if not subobj.wait() == 0:
raise ValueError("Couldn't set property: %s, as %s, in repo %s." raise ValueError("Couldn't set property: %s, as %s, in repo %s."
% (conf_path, value, self.repo_dir)) % (conf_path, value, self.repo_dir))
...@@ -119,7 +119,7 @@ class DCTGit(object): ...@@ -119,7 +119,7 @@ class DCTGit(object):
subobj = subprocess.Popen(cmd, stderr = subprocess.PIPE, \ subobj = subprocess.Popen(cmd, stderr = subprocess.PIPE, \
stdout = subprocess.PIPE) stdout = subprocess.PIPE)
if subobj.wait() is not 0: if not subobj.wait() == 0:
raise ValueError("Couldn't get property: %s, in repo %s." raise ValueError("Couldn't get property: %s, in repo %s."
% (conf_path, self.repo_dir)) % (conf_path, self.repo_dir))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment