1.添加注释

2.format文件
This commit is contained in:
facat 2020-11-14 16:21:08 +08:00
parent 452c582590
commit c9f6939367
4 changed files with 11 additions and 5 deletions

4
cli.py
View File

@ -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()

View File

@ -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(

View File

@ -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 = [

View File

@ -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.")