From 223ed5a22805a9c44bd828e8945ae4172442745d Mon Sep 17 00:00:00 2001 From: facat Date: Sun, 29 Dec 2019 22:17:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=9C=A8SFileAsSingle?= =?UTF-8?q?=E4=B8=AD=E8=BE=93=E5=87=BA=E6=89=80=E6=9C=89=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file_object.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/file_object.py b/file_object.py index d2480ea..4004dd3 100644 --- a/file_object.py +++ b/file_object.py @@ -51,7 +51,7 @@ class SFileObject: ) with open(target_file_path, "wt") as file: for content in self._content: - _content=[str(x) for x in content] + _content = [str(x) for x in content] file.write("{content}\n".format(content=" ".join(_content))) def has(self, tower_number): # 塔位号是否存在S文件中。 @@ -94,6 +94,14 @@ class SFileAsSingle: s_file_obj.write(s_output_file_path) print("update S file {Ss}".format(Ss=s_output_file_path)) + def content(self): + s_file = self._s_files + for s in s_file: + d_file_obj = SFileObject(s) + s_content = d_file_obj.content() + for c in s_content: + yield c + class TaFileObject: def __init__(self, file_path, SFile): @@ -150,6 +158,7 @@ class TaFileObject: # 将S文件中的塔高同步到TA文件中。 def sync_tower_height_from_S(self): + pass def start(self):