[Checkins] SVN: z3c.checkversions/trunk/ Improved "Usage" line.
Christophe Combelles
ccomb at free.fr
Sat May 22 12:16:39 EDT 2010
Log message for revision 112648:
Improved "Usage" line.
Don't accumulate old comments after the versions
Changed:
U z3c.checkversions/trunk/CHANGELOG.txt
U z3c.checkversions/trunk/README.txt
U z3c.checkversions/trunk/z3c/checkversions/base.py
U z3c.checkversions/trunk/z3c/checkversions/buildout.txt
U z3c.checkversions/trunk/z3c/checkversions/main.py
-=-
Modified: z3c.checkversions/trunk/CHANGELOG.txt
===================================================================
--- z3c.checkversions/trunk/CHANGELOG.txt 2010-05-21 22:39:41 UTC (rev 112647)
+++ z3c.checkversions/trunk/CHANGELOG.txt 2010-05-22 16:16:39 UTC (rev 112648)
@@ -4,7 +4,7 @@
0.3 (unreleased)
----------------
-- ...
+- don't accumulate old comments
0.2 (2010-05-22)
----------------
Modified: z3c.checkversions/trunk/README.txt
===================================================================
--- z3c.checkversions/trunk/README.txt 2010-05-21 22:39:41 UTC (rev 112647)
+++ z3c.checkversions/trunk/README.txt 2010-05-22 16:16:39 UTC (rev 112648)
@@ -36,7 +36,7 @@
::
$ checkversions -h
- Usage: checkversions [options]
+ Usage: checkversions [-v] [-l LEVEL] [-i INDEX] [buildout_file]
This script will check new package versions of either your current installed
distributions or a buildout file if provided. It can detect major or minor
Modified: z3c.checkversions/trunk/z3c/checkversions/base.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/base.py 2010-05-21 22:39:41 UTC (rev 112647)
+++ z3c.checkversions/trunk/z3c/checkversions/base.py 2010-05-22 16:16:39 UTC (rev 112648)
@@ -64,11 +64,12 @@
if new_dist and new_dist.parsed_version > parsed_version:
if self.verbose:
- print("%s=%s # was: %s" % (name, new_dist.version, version))
+ print("%s=%s # was: %s"
+ % (name, new_dist.version, version.split()[0]))
else:
print("%s=%s" % (name, new_dist.version))
elif self.verbose:
- print("%s=%s" % (name, version))
+ print("%s=%s" % (name, version.split()[0]))
def get_versions(self):
Modified: z3c.checkversions/trunk/z3c/checkversions/buildout.txt
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/buildout.txt 2010-05-21 22:39:41 UTC (rev 112647)
+++ z3c.checkversions/trunk/z3c/checkversions/buildout.txt 2010-05-22 16:16:39 UTC (rev 112648)
@@ -66,8 +66,30 @@
Reading file:///.../zope.component/
zope.component=3.4.0
+The old comments are removed:
+>>> buildout_fd, buildout_path = mkstemp()
+>>> buildout_file = os.fdopen(buildout_fd, 'w')
+>>> buildout_file.write("""
+... [buildout]
+... index = %s
+... versions = versions
+... [versions]
+... zope.interface = 3.4.1 # was: 3.4.0
+... zope.component = 3.4.0
+... """ % testindex)
+>>> buildout_file.close()
+>>> checker = buildout.Checker(filename=buildout_path, verbose=True)
+>>> checker.check()
+# Checking buildout file ...
+Reading file:///.../zope.interface/
+zope.interface=3.6.1 # was: 3.4.1
+Reading file:///.../zope.component/
+zope.component=3.9.4 # was: 3.4.0
+
+
+
console script
--------------
@@ -80,7 +102,7 @@
>>> p = Popen([sys.executable, main.__file__, '-h'],
... stdout=PIPE, stdin=PIPE, stderr=PIPE)
>>> print p.stdout.read()
-Usage: ... [options]
+Usage: ...
...
Modified: z3c.checkversions/trunk/z3c/checkversions/main.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/main.py 2010-05-21 22:39:41 UTC (rev 112647)
+++ z3c.checkversions/trunk/z3c/checkversions/main.py 2010-05-22 16:16:39 UTC (rev 112648)
@@ -25,7 +25,8 @@
def main():
- parser = OptionParser(description=__doc__)
+ usage = u"Usage: %prog [-v] [-l LEVEL] [-i INDEX] [buildout_file]"
+ parser = OptionParser(description=__doc__, usage=usage)
parser.add_option('-l', '--level',
type='int',
More information about the checkins
mailing list