Commit 445f53a7 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

pep8, pylint fixes

parent 0dcfcb5f
......@@ -129,8 +129,8 @@ def main():
dest="dist",
default="unstable",
help="If running in snapshot mode, automatically set"
" the changelog distribution to this value"
" (default=unstable).")
" the changelog distribution to this value"
" (default=unstable).")
(options, args) = parser.parse_args()
......@@ -170,9 +170,9 @@ def main():
# Get current branch name and type and check if it is a valid one
branch = original_repo.head.reference.name
branch_type = versioning.get_branch_type(branch)
branch_type_str = versioning.get_branch_type(branch)
if branch_type not in BRANCH_TYPES.keys():
if branch_type_str not in BRANCH_TYPES.keys():
allowed_branches = ", ".join(BRANCH_TYPES.keys())
raise ValueError("Malformed branch name '%s', cannot classify as"
" one of %s" % (branch, allowed_branches))
......@@ -182,7 +182,7 @@ def main():
origin_debian = "origin/" + debian_branch
if not debian_branch in original_repo.branches:
# Get default debian branch
default_debian = BRANCH_TYPES[branch_type].default_debian_branch
default_debian = BRANCH_TYPES[branch_type_str].default_debian_branch
origin_debian = "origin/" + default_debian
if not default_debian in original_repo.branches:
original_repo.git.branch(default_debian,
......@@ -316,10 +316,5 @@ def call(cmd):
raise RuntimeError("Command '%s' failed!" % cmd)
def create_temp_directory(suffix):
create_dir_cmd = mktemp("-d", "/tmp/" + suffix + "-XXXXX")
return create_dir_cmd.stdout.strip()
if __name__ == "__main__":
sys.exit(main())
......@@ -321,8 +321,8 @@ def python_version(base_version, vcs_info, mode):
if ((snap and not btype.builds_snapshot) or
(not snap and not btype.builds_release)): # nopep8
raise ValueError("Invalid mode '%s' in branch type '%s'" %
(mode, btypestr))
raise ValueError("Invalid mode '%s' in branch type '%s'" %
(mode, btypestr))
if snap:
v = "%s_%d_%s" % (base_version, vcs_info.revno, vcs_info.revid)
......@@ -453,7 +453,7 @@ __version_user_info__ = "%(user_info)s"
vcs_info=pprint.PrettyPrinter().pformat(dict(v._asdict())),
user_info=user_info())
for pkg_name, pkg_info in config['packages'].items():
for _pkg_name, pkg_info in config['packages'].items():
version_filename = pkg_info['version_file']
log.info("Updating version file '%s'" % version_filename)
version_file = file(version_filename, "w+")
......@@ -492,7 +492,7 @@ def bump_version(new_version):
lines = f.readlines()
for i in range(0, len(lines)):
if not lines[i].startswith("#"):
lines[i] = lines[i].replace(old_version, new_version)
lines[i] = lines[i].replace(old_version, new_version)
f.seek(0)
f.truncate(0)
f.writelines(lines)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment