Skip to content

Commit e9181e9

Browse files
authored
Merge pull request #390 from huacchob/lxml-version-602
updating circuit_maintenance_parser/parser.py Html.clean_line method …
2 parents 9e7007e + 084110f commit e9181e9

File tree

6 files changed

+259
-154
lines changed

6 files changed

+259
-154
lines changed

changes/391.dependencies

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgraded lxml to version 6.0.2 and normalized CRLF line endings in HTML parser output.

circuit_maintenance_parser/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def clean_line(line):
210210
try:
211211
return line.text.strip()
212212
except AttributeError:
213-
return line.strip()
213+
return line.strip().replace("\r\n", "\n").replace("\r", "\n")
214214

215215

216216
class EmailDateParser(Parser):

poetry.lock

Lines changed: 250 additions & 146 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ click = ">=7.1, <9.0"
2626
pydantic = ">=1.10.4,<3"
2727
icalendar = "^5.0.0"
2828
bs4 = "^0.0.2"
29-
lxml = {version = ">= 4.6.2, < 6"}
29+
lxml = ">=6.0.2"
3030
geopy = "^2.1.0"
3131
timezonefinder = ">=6.0.1,<9.0.0"
3232
backoff = "^2.2.1"

tests/unit/data/zayo/zayo9_html_parser_result.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"stamp": 1639526400,
1313
"start": 1641445260,
1414
"status": "RE-SCHEDULED",
15-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
15+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
1616
},
1717
{
1818
"account": "Customer,inc",
@@ -27,7 +27,7 @@
2727
"stamp": 1639526400,
2828
"start": 1641531660,
2929
"status": "RE-SCHEDULED",
30-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
30+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
3131
},
3232
{
3333
"account": "Customer,inc",
@@ -42,6 +42,6 @@
4242
"stamp": 1639526400,
4343
"start": 1641618060,
4444
"status": "RE-SCHEDULED",
45-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
45+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted"
4646
}
4747
]

tests/unit/data/zayo/zayo9_result.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"stamp": 1639526400,
1616
"start": 1641445260,
1717
"status": "RE-SCHEDULED",
18-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
18+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
1919
"uid": "0"
2020
},
2121
{
@@ -34,7 +34,7 @@
3434
"stamp": 1639526400,
3535
"start": 1641531660,
3636
"status": "RE-SCHEDULED",
37-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
37+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
3838
"uid": "0"
3939
},
4040
{
@@ -53,7 +53,7 @@
5353
"stamp": 1639526400,
5454
"start": 1641618060,
5555
"status": "RE-SCHEDULED",
56-
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
56+
"summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted",
5757
"uid": "0"
5858
}
5959
]

0 commit comments

Comments
 (0)