diff --git a/cli.py b/cli.py index e0d1f84..062d866 100644 --- a/cli.py +++ b/cli.py @@ -29,7 +29,7 @@ def sync_all_tower_mileage_to_s(s_files: str, ta_file: str): s_files_list = s_files.split(",") ta_object = TaFileObject(ta_file, s_files_list) ta_object.sync_all_tower_mileage_to_s() - print('同步TA文件中里程到S文件') + print("同步TA文件中里程到S文件") # 将Ta文件塔高同步到S文件中 @@ -40,7 +40,7 @@ def sync_all_tower_height_from_TA_to_S(s_files: str, ta_file: str): s_files_list = s_files.split(",") ta_object = TaFileObject(ta_file, s_files_list) ta_object.sync_all_tower_height_from_TA_to_S(prompt=False) - print('同步TA文件中塔高到S文件') + print("同步TA文件中塔高到S文件") # @click.command() diff --git a/file_object.py b/file_object.py index 3ed52d8..ae75841 100644 --- a/file_object.py +++ b/file_object.py @@ -3,6 +3,7 @@ import datetime import shutil import os.path import re +import typing def file_backup_time(): @@ -14,7 +15,7 @@ def get_directory(file_path): return os.path.dirname(file_path) -def get_file_name_with_extention(file_path): +def get_file_name_with_extention(file_path: str) -> typing.Tuple[str, str]: dir_part = get_directory(file_path) file_name = file_path.replace(dir_part, "").replace("\\", "").replace(r"/", "") (name, ext) = file_name.split(".") @@ -178,6 +179,7 @@ class TaFileObject: # basic_mileage = tower_mileage # return tower_span_record + # 将Ta文件中有变化的塔高同步到S文件中 def sync_changed_tower_height_to_S(self, ta_new_contents, old_tower_height_record): updated = False for ta_entry in ta_new_contents: @@ -200,6 +202,7 @@ class TaFileObject: updated = True return updated + # 将Ta文件中里程同步到S文件中 def sync_all_tower_mileage_to_s(self): ta_new_contents = self._read(self._file_path) new_mileage_dic = {} @@ -226,6 +229,7 @@ class TaFileObject: # ) # ) + # 将所有Ta文件中塔高同步到S文件中 def sync_all_tower_height_from_TA_to_S(self, prompt=True): if prompt: enter_string = input( diff --git a/main.py b/main.py index ed71cb8..f2d94da 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ import generate_ta from file_object import TaFileObject, DFileAsSingle from file_object import DFileObject -import gui +import gui if __name__ == "__main__1": SFile = [ diff --git a/survey.py b/survey.py index 77cc3f2..244462e 100644 --- a/survey.py +++ b/survey.py @@ -16,5 +16,7 @@ def output_pile(cordination_file, output_file): if __name__ == "__main__": # output_pile(r"d:\工程\灵州-青山\排位\道亨\成果表.csv", r"d:\工程\灵州-青山\排位\道亨\最终排位\org_append.TA") - output_pile(r"d:\工程\灵州-青山\排位\道亨\最终排位\成果表-0120.csv", r"d:\工程\灵州-青山\排位\道亨\最终排位\org_append.txt") + output_pile( + r"d:\工程\灵州-青山\排位\道亨\最终排位\成果表-0120.csv", r"d:\工程\灵州-青山\排位\道亨\最终排位\org_append.txt" + ) print("survey. Finished.")