/wddZddlZGddZGddeZGddeZdS) aProvides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVersion. Every version number class implements the following interface: * the 'parse' method takes a string and parses it to some internal representation; if the string is an invalid version number, 'parse' raises a ValueError exception * the class constructor takes an optional string argument which, if supplied, is passed to 'parse' * __str__ reconstructs the string that was passed to 'parse' (or an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) Nc>eZdZdZd dZdZdZdZdZdZ d Z dS) VersionzAbstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route rich comparisons to _cmp. Nc8|r||dSdSNparseselfvstrings z&LooseVersion.parse..:s0111A!"1'(Cxx'/xxr)r component_resplit enumerater;r7r<)r r componentsiobjs r rzLooseVersion.parse5s 11!2!8!8!A!A111  ++  FAs  #C 1     " sA A! A!c|jSr)r rs r rEzLooseVersion.__str__Es |rc&dt|zS)NzLooseVersion ('%s'))rrs r rzLooseVersion.__repr__Is$s4yy00rct|trt|}nt|tstS|j|jkrdS|j|jkrdS|j|jkrdSdS)NrrGr0)rHrrOrr<rIs r rzLooseVersion._cmpMs eS ! ! " ''EEE<00 "! ! <5= ( (1 <%- ' '2 <%- ' '1 ( 'rr) rr)r*r+rJrKrLrVr rrErrr,rr rOrO s>2:4bjAAL    " " " 111     rrO)r+rJrr.rOr,rr r_s& ********|k+k+k+k+k+Wk+k+k+`KKKKKGKKKKKr