parent
452c582590
commit
c9f6939367
4
cli.py
4
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(",")
|
s_files_list = s_files.split(",")
|
||||||
ta_object = TaFileObject(ta_file, s_files_list)
|
ta_object = TaFileObject(ta_file, s_files_list)
|
||||||
ta_object.sync_all_tower_mileage_to_s()
|
ta_object.sync_all_tower_mileage_to_s()
|
||||||
print('同步TA文件中里程到S文件')
|
print("同步TA文件中里程到S文件")
|
||||||
|
|
||||||
|
|
||||||
# 将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(",")
|
s_files_list = s_files.split(",")
|
||||||
ta_object = TaFileObject(ta_file, s_files_list)
|
ta_object = TaFileObject(ta_file, s_files_list)
|
||||||
ta_object.sync_all_tower_height_from_TA_to_S(prompt=False)
|
ta_object.sync_all_tower_height_from_TA_to_S(prompt=False)
|
||||||
print('同步TA文件中塔高到S文件')
|
print("同步TA文件中塔高到S文件")
|
||||||
|
|
||||||
|
|
||||||
# @click.command()
|
# @click.command()
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import datetime
|
||||||
import shutil
|
import shutil
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
|
import typing
|
||||||
|
|
||||||
|
|
||||||
def file_backup_time():
|
def file_backup_time():
|
||||||
|
|
@ -14,7 +15,7 @@ def get_directory(file_path):
|
||||||
return os.path.dirname(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)
|
dir_part = get_directory(file_path)
|
||||||
file_name = file_path.replace(dir_part, "").replace("\\", "").replace(r"/", "")
|
file_name = file_path.replace(dir_part, "").replace("\\", "").replace(r"/", "")
|
||||||
(name, ext) = file_name.split(".")
|
(name, ext) = file_name.split(".")
|
||||||
|
|
@ -178,6 +179,7 @@ class TaFileObject:
|
||||||
# basic_mileage = tower_mileage
|
# basic_mileage = tower_mileage
|
||||||
# return tower_span_record
|
# return tower_span_record
|
||||||
|
|
||||||
|
# 将Ta文件中有变化的塔高同步到S文件中
|
||||||
def sync_changed_tower_height_to_S(self, ta_new_contents, old_tower_height_record):
|
def sync_changed_tower_height_to_S(self, ta_new_contents, old_tower_height_record):
|
||||||
updated = False
|
updated = False
|
||||||
for ta_entry in ta_new_contents:
|
for ta_entry in ta_new_contents:
|
||||||
|
|
@ -200,6 +202,7 @@ class TaFileObject:
|
||||||
updated = True
|
updated = True
|
||||||
return updated
|
return updated
|
||||||
|
|
||||||
|
# 将Ta文件中里程同步到S文件中
|
||||||
def sync_all_tower_mileage_to_s(self):
|
def sync_all_tower_mileage_to_s(self):
|
||||||
ta_new_contents = self._read(self._file_path)
|
ta_new_contents = self._read(self._file_path)
|
||||||
new_mileage_dic = {}
|
new_mileage_dic = {}
|
||||||
|
|
@ -226,6 +229,7 @@ class TaFileObject:
|
||||||
# )
|
# )
|
||||||
# )
|
# )
|
||||||
|
|
||||||
|
# 将所有Ta文件中塔高同步到S文件中
|
||||||
def sync_all_tower_height_from_TA_to_S(self, prompt=True):
|
def sync_all_tower_height_from_TA_to_S(self, prompt=True):
|
||||||
if prompt:
|
if prompt:
|
||||||
enter_string = input(
|
enter_string = input(
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,7 @@ def output_pile(cordination_file, output_file):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# output_pile(r"d:\工程\灵州-青山\排位\道亨\成果表.csv", r"d:\工程\灵州-青山\排位\道亨\最终排位\org_append.TA")
|
# 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.")
|
print("survey. Finished.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue