aboutsummaryrefslogtreecommitdiff
path: root/doc/api/python/example_version_spec.py
blob: 93f5ba50f3ed3d82cb59e0bbe587c41cb266bb91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# vim: set fileencoding=utf-8 sw=4 sts=4 et :

"""This example demonstrates how to use VersionSpec"""

import paludis

# Make a list of versions
versions = [paludis.VersionSpec(v) for v in "1.0 1.1 1.2 1.2-r1 2.0 2.0-try1 2.0-scm 9999".split()]

# For each version...
for v in versions:
    print str(v) + ":"

    # Show the output of various members.
    print "    Remove revision:             %s" % v.remove_revision()
    print "    Revision only:               %s" % v.revision_only()
    print "    Bump:                        %s" % v.bump()
    print "    Is SCM?                      %s" % v.is_scm
    print