Add fallback where CRS is unable to be obtained

This commit is contained in:
Fred Boniface 2024-10-03 11:50:03 +01:00
parent 452ce699ee
commit 87cbd484ce
4 changed files with 15 additions and 10 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
env_conf
include
*.docx
*.pdf
git
run.sh

View File

@ -1,5 +1,5 @@
home = /usr/bin
include-system-site-packages = false
version = 3.11.8
executable = /usr/bin/python3.11
version = 3.12.3
executable = /usr/bin/python3.12
command = /usr/bin/python -m venv /home/fred.boniface/Desktop/diagrams-to-parse/diagram-parser

View File

@ -6,9 +6,6 @@ def start():
if not owlboard_connector.check_connection():
print("Exiting")
sys.exit(1)
#if not gitea_connector.check_connection():
# print("Exiting")
# sys.exit(1)
working_directory = os.getcwd()
print("Working directory: ", working_directory)
@ -36,7 +33,7 @@ def start():
get_detail.append({
'pis': code['pis'],
'services': services,
'diagram_file': code['file'],
'diagram_file': code['source_file'],
'date': code['date'],
'headcode': code['headcode'],
})
@ -58,6 +55,10 @@ def start():
formatted_additions = formatter.humanYaml(details)
print(formatted_additions)
out = open("pis_output", "a")
f.write('\n---\n')
f.write(formatted_additions)
f.close()
gitea_connector.clone_repository()
gitea_connector.commit_and_push_changes(formatted_additions,"From owlbot diagram-parser")

View File

@ -62,8 +62,9 @@ def get_service_detail(trainUid, date):
'vstp': json_res.get('vstp', False)
}
organised = organise_svc(svc_detail)
print(res.text)
print(organised)
#print(res.text)
#print(organised)
print("Service Details Found")
return organised
else:
print("Service Not Found")
@ -95,3 +96,5 @@ def convert_tiploc_to_crs(tiploc):
if json_res:
crs = json_res[0]['3ALPHA']
return crs.lower()
else:
return "NO_CRS"