Add fallback where CRS is unable to be obtained
This commit is contained in:
parent
452ce699ee
commit
87cbd484ce
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
env_conf
|
||||
include
|
||||
*.docx
|
||||
*.pdf
|
||||
git
|
||||
run.sh
|
||||
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -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")
|
||||
@ -94,4 +95,6 @@ def convert_tiploc_to_crs(tiploc):
|
||||
json_res = res.json()
|
||||
if json_res:
|
||||
crs = json_res[0]['3ALPHA']
|
||||
return crs.lower()
|
||||
return crs.lower()
|
||||
else:
|
||||
return "NO_CRS"
|
||||
|
Reference in New Issue
Block a user