[Python-checkins] distutils2: Rewrite a bit the version module documentation.

tarek.ziade python-checkins at python.org
Thu Aug 19 08:34:13 CEST 2010


tarek.ziade pushed 3a88d4ed05e6 to distutils2:

http://hg.python.org/distutils2/rev/3a88d4ed05e6
changeset:   555:3a88d4ed05e6
user:        Alexis Metaireau <ametaireau at gmail.com>
date:        Fri Aug 13 16:36:19 2010 +0200
summary:     Rewrite a bit the version module documentation.
files:       docs/source/library/distutils2.version.rst

diff --git a/docs/source/library/distutils2.version.rst b/docs/source/library/distutils2.version.rst
--- a/docs/source/library/distutils2.version.rst
+++ b/docs/source/library/distutils2.version.rst
@@ -5,12 +5,12 @@
 Distutils2 ships with a python package capable to work with version numbers.
 It's an implementation of version specifiers `as defined in PEP 345
 <http://www.python.org/dev/peps/pep-0345/#version-specifiers>`_ about
-Metadata.
+Metadatas.
 
-`distutils2.version.NormalizedVersion`
-======================================
+NormalizedVersion 
+==================
 
-A Normalized version corresponds to a specific version of a distribution, as
+A Normalized version is a specific version of a distribution, as
 described in the PEP 345. So, you can work with the `NormalizedVersion` like
 this::
 
@@ -31,11 +31,12 @@
 
 NormalizedVersion is used internally by `VersionPredicate` to do his stuff.
 
-`distutils2.version.suggest_normalized_version`
------------------------------------------------
+Suggest a normalized version
+----------------------------
 
-You also can let the normalized version be suggested to you, using the
-`suggest_normalized_version` function::
+Before this version scheme, there was existing others ones. Distutils2 provides
+a tool that suggests a normalized version: the `suggest_normalized_version` 
+function::
 
     >>> suggest_normalized_version('2.1-rc1') 
     2.1c1
@@ -46,8 +47,8 @@
     >>> print suggest_normalized_version('not a version')
     None
 
-`distutils2.version.VersionPredicate`
-=====================================
+Dealing with version predicates 
+===============================
 
 `VersionPredicate` knows how to parse stuff like "ProjectName (>=version)", the
 class also provides a `match` method to test if a version number is the version
@@ -59,6 +60,11 @@
     >>> version.match("1.1.1")
     True
 
-`is_valid_predicate`
---------------------
+You could test if a predicate is a valid one, usng the `is_valid_predicate`
+function::
 
+    >>> is_valid_predicate('FooBar (1.1)')
+    True
+    >>> is_valid_predicate('FooBar (+1.1)')
+    False
+

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list