From 6e7acd77707c16aa79cec22238ef944682d9184b Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 22 Mar 2020 17:27:24 +0000 Subject: Python 2 -> 3 --- https-sync-repos.py | 8 ++++---- https-what-repos.py | 2 +- ssh-sync-repos.py | 8 ++++---- ssh-what-repos.py | 2 +- verilog-integer.py | 2 +- what-branches.py | 4 ++-- what-remotes.py | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/https-sync-repos.py b/https-sync-repos.py index 4b4c735..13766e3 100755 --- a/https-sync-repos.py +++ b/https-sync-repos.py @@ -23,16 +23,16 @@ for elt in ElementTree(file = urlopen(trac_page)).iter("{http://www.w3.org/1999/ url = elt.text repo = url[len(head):-len(tail)] pull = isdir(repo) - print - print url + print("") + print(url) try: if pull: check_call(("git", "fetch", "--all", "--prune"), cwd = repo) - check_call(("git", "pull"), cwd = repo) + check_call(("git", "merge"), cwd = repo) else: check_call(("git", "clone", url, repo)) except: - print "** Error", "pulling" if pull else "cloning", repo + print("** Error", "pulling" if pull else "cloning", repo) errs += 1 exit(errs) diff --git a/https-what-repos.py b/https-what-repos.py index eec3e39..9237f76 100755 --- a/https-what-repos.py +++ b/https-what-repos.py @@ -11,4 +11,4 @@ url = "https://wiki.cryptech.is/wiki/GitRepositories" for x in ElementTree(file = urlopen(url)).iter("{http://www.w3.org/1999/xhtml}code"): if x.text.startswith("https://git.cryptech.is/") and x.text.endswith(".git"): - print x.text + print(x.text) diff --git a/ssh-sync-repos.py b/ssh-sync-repos.py index fd418e4..2cedac3 100755 --- a/ssh-sync-repos.py +++ b/ssh-sync-repos.py @@ -16,16 +16,16 @@ errs = 0 for repo in sorted(info["repos"]): try: if all(c not in repo for c in "*?[]"): - print - print repo + print("") + print(repo) pull = isdir(repo) if pull: check_call(("git", "fetch", "--all", "--prune"), cwd = repo) - check_call(("git", "pull"), cwd = repo) + check_call(("git", "merge"), cwd = repo) else: check_call(("git", "clone", "{}:{}.git".format(user, repo), repo)) except: - print "** Error", "pulling" if pull else "cloning", repo + print("** Error", "pulling" if pull else "cloning", repo) errs += 1 exit(errs) diff --git a/ssh-what-repos.py b/ssh-what-repos.py index 6ecf6ed..2b81056 100755 --- a/ssh-what-repos.py +++ b/ssh-what-repos.py @@ -9,4 +9,4 @@ from subprocess import check_output for repo in sorted(loads(check_output("ssh git@git.cryptech.is info -json -lc".split()))["repos"]): if repo != "gitolite-admin" and not any(c in repo for c in "*?[]"): - print repo + print(repo) diff --git a/verilog-integer.py b/verilog-integer.py index 5186f44..f7eee40 100644 --- a/verilog-integer.py +++ b/verilog-integer.py @@ -57,7 +57,7 @@ class VerilogInteger(object): if __name__ == "__main__": def show(*args): - print "{:20} | {:20} | {:20}".format(*args) + print("{:20} | {:20} | {:20}".format(*args)) show("C", "Verilog", "Input") show("-" * 20, "-" * 20, "-" * 20) diff --git a/what-branches.py b/what-branches.py index 56e2082..34672cc 100755 --- a/what-branches.py +++ b/what-branches.py @@ -9,6 +9,6 @@ from sys import argv for root in argv[1:] or listdir("."): for head, dirs, files in walk(root): if ".git" in dirs and not head.endswith("/gitolite"): - print head + print(head) for line in check_output(("git", "branch", "-a"), cwd = head).splitlines(): - print " ", line + print(" ", line) diff --git a/what-remotes.py b/what-remotes.py index 0359301..0c36467 100755 --- a/what-remotes.py +++ b/what-remotes.py @@ -9,6 +9,6 @@ from sys import argv for root in argv[1:] or listdir("."): for head, dirs, files in walk(root): if ".git" in dirs and not head.endswith("/gitolite"): - print head + print(head) for line in check_output(("git", "remote", "-v"), cwd = head).splitlines(): - print " ", line + print(" ", line) -- cgit v1.2.3