Lines Matching +full:- +full:- +full:verbose
1 """pyversioncheck - Module to help with checking versions"""
7 # Verbose options
8 VERBOSE_SILENT=0 # Single-line reports per package
9 VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated
17 def versioncheck(package, url, version, verbose=0): argument
18 ok, newversion, fp = checkonly(package, url, version, verbose)
19 if verbose > VERBOSE_NORMAL:
24 print '%s: up-to-date (version %s)'%(package, version)
28 if verbose > VERBOSE_SILENT:
35 def checkonly(package, url, version, verbose=0): argument
36 if verbose >= VERBOSE_EACHFILE:
39 ok, newversion, fp = _check1version(package, url, version, verbose)
42 ok, newversion, fp = _check1version(package, u, version, verbose)
43 if ok >= 0 and verbose < VERBOSE_CHECKALL:
47 def _check1version(package, url, version, verbose=0): argument
48 if verbose >= VERBOSE_EACHFILE:
53 if verbose >= VERBOSE_EACHFILE:
55 return -1, None, None
57 newversion = msg.getheader('current-version')
59 if verbose >= VERBOSE_EACHFILE:
60 print ' No "Current-Version:" header in URL or URL not found'
61 return -1, None, None
65 if verbose >= VERBOSE_EACHFILE:
69 if verbose >= VERBOSE_EACHFILE:
76 print '--- TEST VERBOSE=1'
77 print '--- Testing existing and identical version file'
78 versioncheck('VersionTestPackage', _TESTDIR+'Version10.txt', '1.0', verbose=1)
79 print '--- Testing existing package with new version'
80 versioncheck('VersionTestPackage', _TESTDIR+'Version11.txt', '1.0', verbose=1)
81 print '--- Testing package with non-existing version file'
82 versioncheck('VersionTestPackage', _TESTDIR+'nonexistent.txt', '1.0', verbose=1)
83 print '--- Test package with 2 locations, first non-existing second ok'
85 versioncheck('VersionTestPackage', versfiles, '1.0', verbose=1)
86 print '--- TEST VERBOSE=2'
87 print '--- Testing existing and identical version file'
88 versioncheck('VersionTestPackage', _TESTDIR+'Version10.txt', '1.0', verbose=2)
89 print '--- Testing existing package with new version'
90 versioncheck('VersionTestPackage', _TESTDIR+'Version11.txt', '1.0', verbose=2)
91 print '--- Testing package with non-existing version file'
92 versioncheck('VersionTestPackage', _TESTDIR+'nonexistent.txt', '1.0', verbose=2)
93 print '--- Test package with 2 locations, first non-existing second ok'
95 versioncheck('VersionTestPackage', versfiles, '1.0', verbose=2)