aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/create_remote_repo.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-09-09 10:41:19 +0200
committerGuido Günther <agx@sigxcpu.org>2016-09-12 08:52:07 +0200
commitd1c163401153329363a010373cb512f8e59ef1e2 (patch)
tree4360253804301e13b626a47d3ee9b7740dc9fbec /gbp/scripts/create_remote_repo.py
parentf7db3b77c491e5f76f441a1155aa87b1e5dedde6 (diff)
pep8/pyflakes cleanups
Diffstat (limited to 'gbp/scripts/create_remote_repo.py')
-rw-r--r--gbp/scripts/create_remote_repo.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py
index ffc32eaa..85a49b54 100644
--- a/gbp/scripts/create_remote_repo.py
+++ b/gbp/scripts/create_remote_repo.py
@@ -70,6 +70,7 @@ def print_config(remote, branches):
remote = %s
merge = refs/heads/%s""" % (branch, remote['name'], branch))
+
def sort_dict(d):
"""Return a sorted list of (key, value) tuples"""
s = []
@@ -77,6 +78,7 @@ def sort_dict(d):
s.append((key, d[key]))
return s
+
def parse_url(remote_url, name, pkg, template_dir=None):
"""
Sanity check our remote URL
@@ -116,7 +118,7 @@ def parse_url(remote_url, name, pkg, template_dir=None):
else:
raise GbpError("URL must use ssh protocol.")
- if not '%(pkg)s' in remote_url and not remote_url.endswith(".git"):
+ if '%(pkg)s' not in remote_url and not remote_url.endswith(".git"):
raise GbpError("URL needs to contain either a repository name or '%(pkg)s'")
if ":" in frags.netloc:
@@ -162,7 +164,7 @@ def build_remote_script(remote, branch):
args['git-init-args'] = '--bare --shared'
if args['template-dir']:
args['git-init-args'] += (' --template=%s'
- % args['template-dir'])
+ % args['template-dir'])
remote_script_pattern = ['',
'set -e',
'umask 002',
@@ -214,7 +216,7 @@ def read_yn():
if old_settings:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
- if ch in ( 'y', 'Y' ):
+ if ch in ('y', 'Y'):
return True
else:
return False
@@ -293,7 +295,7 @@ def parse_args(argv, sections=[]):
# section to parse, this makes e.g. --help work as expected:
for arg in argv:
if arg.startswith('--remote-config='):
- sections = ['remote-config %s' % arg.split('=',1)[1]]
+ sections = ['remote-config %s' % arg.split('=', 1)[1]]
break
else:
sections = []
@@ -325,12 +327,12 @@ def main(argv):
try:
branches = []
- for branch in [ options.debian_branch, options.upstream_branch ]:
+ for branch in [options.debian_branch, options.upstream_branch]:
if repo.has_branch(branch):
- branches += [ branch ]
+ branches += [branch]
if repo.has_pristine_tar_branch() and options.pristine_tar:
- branches += [ repo.pristine_tar_branch ]
+ branches += [repo.pristine_tar_branch]
try:
cp = ChangeLog(filename=changelog)