コード例 #1
0
ファイル: PathUtils.py プロジェクト: chungtseng/HCPU_midterm
 def getPathListFromFile( pathFile ):
     lPaths = []
     pathFileHandler = open( pathFile, "r" )
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath = Path()
         iPath.setFromString( line )
         lPaths.append( iPath )
     pathFileHandler.close()
     return lPaths
コード例 #2
0
ファイル: PathUtils.py プロジェクト: chungtseng/HCPU_midterm
 def convertPathFileIntoSetFile( pathFile, setFile ):
     pathFileHandler = open( pathFile, "r" )
     setFileHandler = open( setFile, "w" )
     iPath = Path()
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath.setFromString( line )
         iSet = iPath.getSubjectAsSetOfQuery()
         iSet.write( setFileHandler )
     pathFileHandler.close()
     setFileHandler.close()
コード例 #3
0
ファイル: PathUtils.py プロジェクト: chungtseng/HCPU_midterm
 def convertPathFileIntoAlignFile(pathFile, alignFile):
     pathFileHandler = open( pathFile, "r" )
     alignFileHandler = open( alignFile, "w" )
     iPath = Path()
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath.setFromString( line )
         iAlign = iPath.getAlignInstance()
         iAlign.write( alignFileHandler )
     pathFileHandler.close()
     alignFileHandler.close()
コード例 #4
0
ファイル: PathUtils.py プロジェクト: chungtseng/HCPU_midterm
 def getDictOfListsWithIdAsKeyFromFile( pathFile ):
     dId2PathList = {}
     pathFileHandler = open( pathFile, "r" )
     while True:
         line = pathFileHandler.readline()
         if line == "":
             break
         iPath = Path()
         iPath.setFromString( line )
         if dId2PathList.has_key( iPath.id ):
             dId2PathList[ iPath.id ].append( iPath )
         else:
             dId2PathList[ iPath.id ] = [ iPath ]
     pathFileHandler.close()
     return dId2PathList