Mercurial > repos > guerler > springsuite
comparison spring_package/DBKit.py @ 37:0be0af9e695d draft
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
author | guerler |
---|---|
date | Wed, 25 Nov 2020 14:35:35 +0000 |
parents | |
children | 172398348efd |
comparison
equal
deleted
inserted
replaced
36:2fe8ffff530d | 37:0be0af9e695d |
---|---|
1 def createFile(identifier, databaseIndex, database, outputName): | |
2 start = -1 | |
3 size = 0 | |
4 with open(databaseIndex) as file: | |
5 for line in file: | |
6 cols = line.split() | |
7 if identifier == cols[0]: | |
8 start = int(cols[1]) | |
9 size = int(cols[2]) | |
10 break | |
11 if start != -1 and size > 0: | |
12 with open(database) as file: | |
13 file.seek(start) | |
14 content = file.read(size) | |
15 outputFile = open(outputName, "w") | |
16 outputFile.write(content) | |
17 outputFile.close() | |
18 return True | |
19 else: | |
20 return False |