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
|
env_conf
|
||||||
include
|
include
|
||||||
*.docx
|
*.docx
|
||||||
|
*.pdf
|
||||||
git
|
git
|
||||||
run.sh
|
run.sh
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
home = /usr/bin
|
home = /usr/bin
|
||||||
include-system-site-packages = false
|
include-system-site-packages = false
|
||||||
version = 3.11.8
|
version = 3.12.3
|
||||||
executable = /usr/bin/python3.11
|
executable = /usr/bin/python3.12
|
||||||
command = /usr/bin/python -m venv /home/fred.boniface/Desktop/diagrams-to-parse/diagram-parser
|
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():
|
if not owlboard_connector.check_connection():
|
||||||
print("Exiting")
|
print("Exiting")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
#if not gitea_connector.check_connection():
|
|
||||||
# print("Exiting")
|
|
||||||
# sys.exit(1)
|
|
||||||
working_directory = os.getcwd()
|
working_directory = os.getcwd()
|
||||||
print("Working directory: ", working_directory)
|
print("Working directory: ", working_directory)
|
||||||
|
|
||||||
@ -36,7 +33,7 @@ def start():
|
|||||||
get_detail.append({
|
get_detail.append({
|
||||||
'pis': code['pis'],
|
'pis': code['pis'],
|
||||||
'services': services,
|
'services': services,
|
||||||
'diagram_file': code['file'],
|
'diagram_file': code['source_file'],
|
||||||
'date': code['date'],
|
'date': code['date'],
|
||||||
'headcode': code['headcode'],
|
'headcode': code['headcode'],
|
||||||
})
|
})
|
||||||
@ -58,6 +55,10 @@ def start():
|
|||||||
|
|
||||||
formatted_additions = formatter.humanYaml(details)
|
formatted_additions = formatter.humanYaml(details)
|
||||||
print(formatted_additions)
|
print(formatted_additions)
|
||||||
|
out = open("pis_output", "a")
|
||||||
|
f.write('\n---\n')
|
||||||
|
f.write(formatted_additions)
|
||||||
|
f.close()
|
||||||
|
|
||||||
gitea_connector.clone_repository()
|
gitea_connector.clone_repository()
|
||||||
gitea_connector.commit_and_push_changes(formatted_additions,"From owlbot diagram-parser")
|
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)
|
'vstp': json_res.get('vstp', False)
|
||||||
}
|
}
|
||||||
organised = organise_svc(svc_detail)
|
organised = organise_svc(svc_detail)
|
||||||
print(res.text)
|
#print(res.text)
|
||||||
print(organised)
|
#print(organised)
|
||||||
|
print("Service Details Found")
|
||||||
return organised
|
return organised
|
||||||
else:
|
else:
|
||||||
print("Service Not Found")
|
print("Service Not Found")
|
||||||
@ -94,4 +95,6 @@ def convert_tiploc_to_crs(tiploc):
|
|||||||
json_res = res.json()
|
json_res = res.json()
|
||||||
if json_res:
|
if json_res:
|
||||||
crs = json_res[0]['3ALPHA']
|
crs = json_res[0]['3ALPHA']
|
||||||
return crs.lower()
|
return crs.lower()
|
||||||
|
else:
|
||||||
|
return "NO_CRS"
|
||||||
|
Reference in New Issue
Block a user