summaryrefslogtreecommitdiffstats
path: root/Tools/versioncheck
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/versioncheck
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/versioncheck')
-rw-r--r--Tools/versioncheck/checkversions.py4
-rw-r--r--Tools/versioncheck/pyversioncheck.py42
2 files changed, 23 insertions, 23 deletions
diff --git a/Tools/versioncheck/checkversions.py b/Tools/versioncheck/checkversions.py
index fd128b6..27c16e7 100644
--- a/Tools/versioncheck/checkversions.py
+++ b/Tools/versioncheck/checkversions.py
@@ -28,7 +28,7 @@ def check1dir(dummy, dir, files):
try:
execfile(fullname)
except:
- print '** Exception in', fullname
+ print('** Exception in', fullname)
def walk1tree(tree):
os.path.walk(tree, check1dir, None)
@@ -38,7 +38,7 @@ def main():
try:
options, arguments = getopt.getopt(sys.argv[1:], 'v:')
except getopt.error:
- print USAGE
+ print(USAGE)
sys.exit(1)
for o, a in options:
if o == '-v':
diff --git a/Tools/versioncheck/pyversioncheck.py b/Tools/versioncheck/pyversioncheck.py
index ff04122..b36fcce 100644
--- a/Tools/versioncheck/pyversioncheck.py
+++ b/Tools/versioncheck/pyversioncheck.py
@@ -18,12 +18,12 @@ def versioncheck(package, url, version, verbose=0):
if verbose > VERBOSE_NORMAL:
return ok
if ok < 0:
- print '%s: No correctly formatted current version file found'%(package)
+ print('%s: No correctly formatted current version file found'%(package))
elif ok == 1:
- print '%s: up-to-date (version %s)'%(package, version)
+ print('%s: up-to-date (version %s)'%(package, version))
else:
- print '%s: version %s installed, version %s found:' % \
- (package, version, newversion)
+ print('%s: version %s installed, version %s found:' % \
+ (package, version, newversion))
if verbose > VERBOSE_SILENT:
while 1:
line = fp.readline()
@@ -33,7 +33,7 @@ def versioncheck(package, url, version, verbose=0):
def checkonly(package, url, version, verbose=0):
if verbose >= VERBOSE_EACHFILE:
- print '%s:'%package
+ print('%s:'%package)
if isinstance(url, str):
ok, newversion, fp = _check1version(package, url, version, verbose)
else:
@@ -45,51 +45,51 @@ def checkonly(package, url, version, verbose=0):
def _check1version(package, url, version, verbose=0):
if verbose >= VERBOSE_EACHFILE:
- print ' Checking %s'%url
+ print(' Checking %s'%url)
try:
fp = urllib.urlopen(url)
except IOError as arg:
if verbose >= VERBOSE_EACHFILE:
- print ' Cannot open:', arg
+ print(' Cannot open:', arg)
return -1, None, None
msg = rfc822.Message(fp, seekable=0)
newversion = msg.getheader('current-version')
if not newversion:
if verbose >= VERBOSE_EACHFILE:
- print ' No "Current-Version:" header in URL or URL not found'
+ print(' No "Current-Version:" header in URL or URL not found')
return -1, None, None
version = version.lower().strip()
newversion = newversion.lower().strip()
if version == newversion:
if verbose >= VERBOSE_EACHFILE:
- print ' Version identical (%s)'%newversion
+ print(' Version identical (%s)'%newversion)
return 1, version, fp
else:
if verbose >= VERBOSE_EACHFILE:
- print ' Versions different (installed: %s, new: %s)'% \
- (version, newversion)
+ print(' Versions different (installed: %s, new: %s)'% \
+ (version, newversion))
return 0, newversion, fp
def _test():
- print '--- TEST VERBOSE=1'
- print '--- Testing existing and identical version file'
+ print('--- TEST VERBOSE=1')
+ print('--- Testing existing and identical version file')
versioncheck('VersionTestPackage', _TESTDIR+'Version10.txt', '1.0', verbose=1)
- print '--- Testing existing package with new version'
+ print('--- Testing existing package with new version')
versioncheck('VersionTestPackage', _TESTDIR+'Version11.txt', '1.0', verbose=1)
- print '--- Testing package with non-existing version file'
+ print('--- Testing package with non-existing version file')
versioncheck('VersionTestPackage', _TESTDIR+'nonexistent.txt', '1.0', verbose=1)
- print '--- Test package with 2 locations, first non-existing second ok'
+ print('--- Test package with 2 locations, first non-existing second ok')
versfiles = [_TESTDIR+'nonexistent.txt', _TESTDIR+'Version10.txt']
versioncheck('VersionTestPackage', versfiles, '1.0', verbose=1)
- print '--- TEST VERBOSE=2'
- print '--- Testing existing and identical version file'
+ print('--- TEST VERBOSE=2')
+ print('--- Testing existing and identical version file')
versioncheck('VersionTestPackage', _TESTDIR+'Version10.txt', '1.0', verbose=2)
- print '--- Testing existing package with new version'
+ print('--- Testing existing package with new version')
versioncheck('VersionTestPackage', _TESTDIR+'Version11.txt', '1.0', verbose=2)
- print '--- Testing package with non-existing version file'
+ print('--- Testing package with non-existing version file')
versioncheck('VersionTestPackage', _TESTDIR+'nonexistent.txt', '1.0', verbose=2)
- print '--- Test package with 2 locations, first non-existing second ok'
+ print('--- Test package with 2 locations, first non-existing second ok')
versfiles = [_TESTDIR+'nonexistent.txt', _TESTDIR+'Version10.txt']
versioncheck('VersionTestPackage', versfiles, '1.0', verbose=2)