def __init__(self): StrictVersion.__init__(self) tversion = '0.0.0' ccp4_major_minor = os.path.join(os.environ["CCP4"], "lib", "ccp4", "MAJOR_MINOR") if os.path.isfile(ccp4_major_minor): with open(ccp4_major_minor, "r") as f_in: tversion = f_in.read().strip() self.parse(tversion)
def __init__(self): StrictVersion.__init__(self) ccp4_major_minor = os.path.join(os.environ["CCP4"], "lib", "ccp4", "MAJOR_MINOR") if os.path.isfile(ccp4_major_minor): with open(ccp4_major_minor, "r") as f_in: tversion = f_in.read().strip() else: logger = logging.getLogger(__name__) logger.debug("Detecting CCP4 version via executing pdbcur") stdout = cexec(['pdbcur' + EXE_EXT], permit_nonzero=True) tversion = None for line in stdout.split(os.linesep): if line.startswith(' ### CCP4'): tversion = line.split()[2].rstrip(':') if tversion is None: raise RuntimeError("Cannot determine CCP4 version") self.parse(tversion)
def __init__(self, v): print(v) if v.endswith('a'): v += '0' StrictVersion.__init__(self, v)
def __init__(self, version): match = re.match("dlib-(\d+).(\d+).*", version) major = match.group(1) minor = match.group(2) StrictVersion.__init__(self, major + "." + minor)
def __init__(self, vstring): StrictVersion.__init__(self, vstring) self.prerelease = None
def __init__(self, v): print v if v.endswith('a'): v += '0' StrictVersion.__init__(self, v)
def __init__(self, v): if isinstance(v, bytes): v = v.decode('ascii') if v.endswith('a'): v += '0' StrictVersion.__init__(self, v)