Skip to content
Snippets Groups Projects
Commit ba4c5deb authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

py3: move print statements to the print function

parent 307b9c16
No related branches found
No related tags found
No related merge requests found
""" Ensure that all repository are cloned and at their tip
"""
from __future__ import print_function
import errno
import os
import subprocess
......@@ -18,7 +19,7 @@
raise
for repo_name, repo in config["repos"].items():
clonedir = join(repos_dir, repo_name)
print partial_revset
print(partial_revset)
for pset, setconfig in partial_revset.items():
revset = setconfig.get('remove')
repo_suffix = urllib.quote_plus(revset)
......
......@@ -13,6 +13,7 @@
can edit this file, please use an editor that detects when the tasks file
changed since you start editing it (at least nano does it).
"""
from __future__ import print_function
import re
import os
import argparse
......
......@@ -2,6 +2,8 @@
#
# Script to setup the reference repository used for benchmarl
from __future__ import print_function
DEFAULT_REPO_SOURCE = "https://static.octobus.net/asv/"
import hashlib
......@@ -40,10 +42,10 @@
Repository will be fetch from `source` and setup in `repodir`
"""
print "Setting up reference repository: %s" % repo
print("Setting up reference repository: %s" % repo)
# setup one
# download reference
# extract partial from `.benchrepo`
# setup partial
# download partial
# hg update the reference
......@@ -44,10 +46,10 @@
# setup one
# download reference
# extract partial from `.benchrepo`
# setup partial
# download partial
# hg update the reference
print ' main reference'
print(' main reference')
setup_repo_variant(repodir, source, repo, None, update=True)
refpath = join(repodir, repo + '.benchrepo')
if not os.path.exists(refpath):
......@@ -51,7 +53,7 @@
setup_repo_variant(repodir, source, repo, None, update=True)
refpath = join(repodir, repo + '.benchrepo')
if not os.path.exists(refpath):
print ' missing data file'
print(' missing data file')
setup_repo_variant(repodir, source, repo, None, update=True, force=True)
refdata = read_yaml(refpath)
partial_sets = refdata.get("partial-sets")
......@@ -60,7 +62,7 @@
raise SetupError(msg)
for variant in sorted(partial_sets):
print ' partial reference: ', variant
print(' partial reference: ', variant)
setup_repo_variant(repodir, source, repo, variant)
def repobasename(repo_name, partial_id):
......@@ -152,7 +154,7 @@
repo_path = repopath(repo_dir, repo_name, partial_id)
setup_file = setupfile(repo_path)
if os.path.exists(setup_file) and not force:
print ' already up to date'
print(' already up to date')
return
if os.path.exists(repo_path):
shutil.rmtree(repo_path)
......@@ -156,6 +158,6 @@
return
if os.path.exists(repo_path):
shutil.rmtree(repo_path)
print ' downloading repo'
print(' downloading repo')
download_repo(repo_dir, source, repo_name, partial_id)
if update:
......@@ -160,6 +162,6 @@
download_repo(repo_dir, source, repo_name, partial_id)
if update:
print ' updating repo'
print(' updating repo')
update_repo(repo_path)
conclude_setup(repo_path)
......@@ -177,12 +179,12 @@
if __name__ == "__main__":
if not (2 <= len(sys.argv) <= 4):
print >> sys.stderr, "usage: %s REPOS-FILE [DIRECTORY [SOURCE]]"
print >> sys.stderr, ""
print >> sys.stderr, "Make sure all item in REPOS-FILE are setup in DIRECTORY."
print >> sys.stderr, "(default `.`)."
print >> sys.stderr, "When missing, data are fetched from SOURCE"
print >> sys.stderr, "(default: %s)" % DEFAULT_REPO_SOURCE
print("usage: %s REPOS-FILE [DIRECTORY [SOURCE]]", file=sys.stderr)
print("", file=sys.stderr)
print("Make sure all item in REPOS-FILE are setup in DIRECTORY.", file=sys.stderr)
print("(default `.`).", file=sys.stderr)
print("When missing, data are fetched from SOURCE", file=sys.stderr)
print("(default: %s)" % DEFAULT_REPO_SOURCE, file=sys.stderr)
sys.exit(128)
reposfile = sys.argv[1]
......@@ -203,6 +205,6 @@
try:
setup_all_repos(repo_dir, source, repos)
except SetupError as exc:
print >> sys.stderr, 'abort:', str(exc)
print('abort:', str(exc), file=sys.stderr)
sys.exit(1)
sys.exit(0)
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