Removed exeption causing error in downloaded data

This commit is contained in:
Fred Boniface 2024-04-02 14:21:40 +01:00
parent 8e6bb25471
commit 0a494ad81f
4 changed files with 22 additions and 21 deletions

View File

@ -14,24 +14,25 @@ Diagrams are received in DOCX format, however can be easily be converted to ODT,
The aim of diagram-parser is to simplify the addition of PIS codes that are not yet in the OwlBoard data source. The planned implementation is as follows: The aim of diagram-parser is to simplify the addition of PIS codes that are not yet in the OwlBoard data source. The planned implementation is as follows:
- diagram-parser is subscribed to an email inbox (IMAP/POP3) - diagram-parser is subscribed to an email inbox (IMAP/POP3)
- Formatted train-crew schedule cards are sent to the inbox and loaded by diagram-parser - Formatted train-crew schedule cards are sent to the inbox and loaded by diagram-parser
- List of existing PIS codes is loaded and a list of non-existent codes is compiled (0000-9999) - List of existing PIS codes is loaded and a list of non-existent codes is compiled (0000-9999)
- If a code is found both in the diagram and on the list of non-existent codes, a Gitea issue is opened providing details of the code. - If a code is found both in the diagram and on the list of non-existent codes, a Gitea issue is opened providing details of the code.
- Once the program has run and extracted only the relavent details, the email is deleted and the file is closed and not stored. - Once the program has run and extracted only the relavent details, the email is deleted and the file is closed and not stored.
- The evantual aim is to avoid any manual searching of the files. - The evantual aim is to avoid any manual searching of the files.
The current process of adding new codes involves being made aware of them face to face, or finding them myself and manually finding and adding them to the data source. The current process of adding new codes involves being made aware of them face to face, or finding them myself and manually finding and adding them to the data source.
## Points to Remember ## Points to Remember
- Emails received should be verified. - Emails received should be verified.
- A pre-authorised key in the subject field, any emails not matching the key should be discarded. - A pre-authorised key in the subject field, any emails not matching the key should be discarded.
- Attachment formats may vary slightly. - Attachment formats may vary slightly.
- The format of the attachment should be checked and any errors handled gracefully. - The format of the attachment should be checked and any errors handled gracefully.
- Avoid duplicate issues - Avoid duplicate issues
- Issues opened should contain the missing PIS code in their title, this application should check for any open issues containing the missing code to avoid duplicated issues. - Issues opened should contain the missing PIS code in their title, this application should check for any open issues containing the missing code to avoid duplicated issues.
## Main external dependencies (Expected) ## Main external dependencies (Expected)
- imaplib
- email - imaplib
- email

View File

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

View File

@ -20,8 +20,9 @@ def humanYaml(pis_list):
manual_review += f' - code: "{pis["pis"]}"\n' manual_review += f' - code: "{pis["pis"]}"\n'
for service in pis["services"]: for service in pis["services"]:
crs = [] crs = []
for stop in service['stops']: if service and service['stops']:
crs.append(owlboard_connector.convert_tiploc_to_crs(stop)) for stop in service['stops']:
manual_review += f' stops: [{",".join(crs)}]\n' crs.append(owlboard_connector.convert_tiploc_to_crs(stop))
manual_review += f' stops: [{",".join(crs)}]\n'
return additional_pis + manual_review return additional_pis + manual_review

@ -1 +0,0 @@
Subproject commit 194f20ea6fe89c423af752f2869d67c44ee194f5