minideblib.DpkgVersion
index
minideblib/DpkgVersion.py

Parse and compare Debian version strings.
 
This module contains a class designed to sit in your Python code pretty
naturally and represent a Debian version string.  It implements various
special methods to make dealing with them sweet.

 
Modules
       
re

 
Classes
       
__builtin__.object
DpkgVersion
exceptions.Exception(exceptions.BaseException)
VersionError
BadInputError
BadEpochError
BadRevisionError
BadUpstreamError

 
class BadEpochError(BadInputError)
    
Method resolution order:
BadEpochError
BadInputError
VersionError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors inherited from VersionError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x81419a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class BadInputError(VersionError)
    
Method resolution order:
BadInputError
VersionError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors inherited from VersionError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x81419a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class BadRevisionError(BadInputError)
    
Method resolution order:
BadRevisionError
BadInputError
VersionError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors inherited from VersionError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x81419a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class BadUpstreamError(BadInputError)
    
Method resolution order:
BadUpstreamError
BadInputError
VersionError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors inherited from VersionError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x81419a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class DpkgVersion(__builtin__.object)
    Debian version number.
 
This class is designed to be reasonably transparent and allow you to write code like:
 
>>> s.version >= '1.100-1'
 
The comparison will be done according to Debian rules, so '1.2' will compare lower.
 
Properties:
 - epoch: Epoch
 - upstream: Upstream version
 - revision: Debian/local revision
 
  Methods defined here:
__cmp__(self, other)
Compare two Version classes.
__init__(self, ver)
Parse a string or number into the three components.
__repr__(self)
Return a debugging representation of the object.
__str__(self)
Return the class as a string for printing.
getWithoutEpoch(self)
Return the version without the epoch.
is_native(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
without_epoch
Return the version without the epoch.

 
class VersionError(exceptions.Exception)
    
Method resolution order:
VersionError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x81419a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
Functions
       
deb_cmp(x, y)
Implement the string comparison outlined by Debian policy.
deb_cmp_str(x, y)
Compare two strings in a deb version.
deb_order(str, idx)
Return the comparison order of two characters.
strcut(str, idx, accept)
Cut characters from str that are entirely in accept.

 
Data
        __author__ = 'Scott James Remnant <scott@netsplit.com>'
cmp_table = '~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-.:'
valid_epoch = <_sre.SRE_Pattern object at 0x82b9f20>
valid_revision = <_sre.SRE_Pattern object at 0x82b7e60>
valid_upstream = <_sre.SRE_Pattern object at 0x82d0860>

 
Author
        Scott James Remnant <scott@netsplit.com>