Exemplo n.º 1
0
    def getPackVersion( self, strMetaDataFileContents ):
        "extract a version from a metadata file"
#        print( "INF: LifeData.getPackVersion: strMetaDataFileContents: " +strMetaDataFileContents );
        nPick = strMetaDataFileContents.find( "<version>" );
        if( nPick == -1 ):
            print( "INF: LifeData.getPackVersion: no version number found in data (data size: %d)" % ( len( strMetaDataFileContents ) ) );
            return 0.;
        rVersion = stringtools.findNumber( strMetaDataFileContents[nPick:] );
        return rVersion;
Exemplo n.º 2
0
 def getFileVersion( self, strFilePath ):
     "extract a version from a life_data file (yeah it's this file, but find it without loading it with python)"
     enclosedFileData = filetools.getFileContents( strFilePath );
     # print( "INF: LifeData.getFileVersion: '%s'" % enclosedFileData );
     nPick = enclosedFileData.find( "rLifeDataVersionNumber" );
     if( nPick == -1 ):
         print( "INF: LifeData.getFileVersion: no version number found in %s (file size: %d)" % ( strFilePath, len( enclosedFileData ) ) );
         return 0.;
     rVersion = stringtools.findNumber( enclosedFileData[nPick:] );
     return rVersion;
Exemplo n.º 3
0
 def getPackVersion(self, strMetaDataFileContents):
     "extract a version from a metadata file"
     #        print( "INF: LifeData.getPackVersion: strMetaDataFileContents: " +strMetaDataFileContents );
     nPick = strMetaDataFileContents.find("<version>")
     if (nPick == -1):
         print(
             "INF: LifeData.getPackVersion: no version number found in data (data size: %d)"
             % (len(strMetaDataFileContents)))
         return 0.
     rVersion = stringtools.findNumber(strMetaDataFileContents[nPick:])
     return rVersion
Exemplo n.º 4
0
 def getFileVersion(self, strFilePath):
     "extract a version from a life_data file (yeah it's this file, but find it without loading it with python)"
     enclosedFileData = filetools.getFileContents(strFilePath)
     # print( "INF: LifeData.getFileVersion: '%s'" % enclosedFileData );
     nPick = enclosedFileData.find("rLifeDataVersionNumber")
     if (nPick == -1):
         print(
             "INF: LifeData.getFileVersion: no version number found in %s (file size: %d)"
             % (strFilePath, len(enclosedFileData)))
         return 0.
     rVersion = stringtools.findNumber(enclosedFileData[nPick:])
     return rVersion