1.修复了一个bug。TA同步到S中时耐张塔呼高只改了一个。
This commit is contained in:
@@ -54,11 +54,12 @@ class SFileObject:
|
|||||||
_content = [str(x) for x in content]
|
_content = [str(x) for x in content]
|
||||||
file.write("{content}\n".format(content=" ".join(_content)))
|
file.write("{content}\n".format(content=" ".join(_content)))
|
||||||
|
|
||||||
def has(self, tower_number): # 塔位号是否存在S文件中。
|
def has(self, tower_number): # 塔位号是否存在S文件中。可能存在多行的情况。
|
||||||
|
indexes=[]
|
||||||
for index, content in enumerate(self._content):
|
for index, content in enumerate(self._content):
|
||||||
if content[0] == tower_number:
|
if content[0] == tower_number:
|
||||||
return index
|
indexes.append(index)
|
||||||
return 0
|
return indexes
|
||||||
|
|
||||||
def content(self):
|
def content(self):
|
||||||
return self._content
|
return self._content
|
||||||
@@ -79,8 +80,8 @@ class SFileAsSingle:
|
|||||||
ret = []
|
ret = []
|
||||||
for s in s_file:
|
for s in s_file:
|
||||||
d_file_obj = SFileObject(s)
|
d_file_obj = SFileObject(s)
|
||||||
index = d_file_obj.has(tower_number)
|
indexes = d_file_obj.has(tower_number)
|
||||||
if index > 0:
|
for index in indexes:
|
||||||
ret.append((d_file_obj, index))
|
ret.append((d_file_obj, index))
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user