civics-cdf-validator 1.49.dev15__tar.gz → 1.49.dev17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {civics_cdf_validator-1.49.dev15/civics_cdf_validator.egg-info → civics_cdf_validator-1.49.dev17}/PKG-INFO +1 -1
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/loggers.py +0 -2
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/rules.py +28 -13
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/version.py +1 -1
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/README.md +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/__init__.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/base.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/office_utils.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/setup.cfg +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/setup.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/stats.py +0 -0
- {civics_cdf_validator-1.49.dev15 → civics_cdf_validator-1.49.dev17}/validator.py +0 -0
|
@@ -84,7 +84,6 @@ class ElectionInfo(ElectionException):
|
|
|
84
84
|
|
|
85
85
|
def get_parent_hierarchy_object_id_str(elt):
|
|
86
86
|
"""Get the elt path from the 1st parent with an objectId / ElectionReport."""
|
|
87
|
-
|
|
88
87
|
elt_hierarchy = []
|
|
89
88
|
current_elt = elt
|
|
90
89
|
while current_elt is not None:
|
|
@@ -203,4 +202,3 @@ def severities_names():
|
|
|
203
202
|
for exp in ExceptionListWrapper.SUPPORTED_SEVERITIES:
|
|
204
203
|
names.append(exp.description.lower())
|
|
205
204
|
return names
|
|
206
|
-
|
|
@@ -3018,8 +3018,10 @@ class RemovePersonAndOfficeHolderId60DaysAfterEndDate(base.TreeRule):
|
|
|
3018
3018
|
self.election_tree, "OfficeHolderTenure"
|
|
3019
3019
|
)
|
|
3020
3020
|
for officeholder_tenure in officeholder_tenures:
|
|
3021
|
-
|
|
3022
|
-
|
|
3021
|
+
office_holder_person_elem = officeholder_tenure.find(
|
|
3022
|
+
"OfficeHolderPersonId"
|
|
3023
|
+
)
|
|
3024
|
+
person_id = office_holder_person_elem.text
|
|
3023
3025
|
date_validator = base.DateRule(None, None)
|
|
3024
3026
|
date_validator.gather_dates(officeholder_tenure)
|
|
3025
3027
|
end_date = date_validator.end_date
|
|
@@ -3033,13 +3035,15 @@ class RemovePersonAndOfficeHolderId60DaysAfterEndDate(base.TreeRule):
|
|
|
3033
3035
|
sixty_days_earlier.day,
|
|
3034
3036
|
)
|
|
3035
3037
|
if end_date < partial_date_sixty_days:
|
|
3036
|
-
outdated_officeholder_tenures.append(
|
|
3038
|
+
outdated_officeholder_tenures.append(officeholder_tenure)
|
|
3037
3039
|
if person_id in outdated_officetenure_persons.keys():
|
|
3038
3040
|
outdated_officetenure_persons[person_id].append(
|
|
3039
|
-
(
|
|
3041
|
+
(office_holder_person_elem, end_date)
|
|
3040
3042
|
)
|
|
3041
3043
|
else:
|
|
3042
|
-
outdated_officetenure_persons[person_id] = [
|
|
3044
|
+
outdated_officetenure_persons[person_id] = [
|
|
3045
|
+
(office_holder_person_elem, end_date)
|
|
3046
|
+
]
|
|
3043
3047
|
for outdated_officeholder_tenure in outdated_officeholder_tenures:
|
|
3044
3048
|
info_message = (
|
|
3045
3049
|
"The officeholder tenure end date is more than 60 days"
|
|
@@ -3051,7 +3055,9 @@ class RemovePersonAndOfficeHolderId60DaysAfterEndDate(base.TreeRule):
|
|
|
3051
3055
|
)
|
|
3052
3056
|
for person_id, value_list in outdated_officetenure_persons.items():
|
|
3053
3057
|
has_recent_tenure = False
|
|
3058
|
+
office_holder_person_elem = None
|
|
3054
3059
|
for value in value_list:
|
|
3060
|
+
office_holder_person_elem = value[0]
|
|
3055
3061
|
end_date = value[1]
|
|
3056
3062
|
sixty_days_earlier = datetime.datetime.now() + datetime.timedelta(
|
|
3057
3063
|
days=-60
|
|
@@ -3063,13 +3069,15 @@ class RemovePersonAndOfficeHolderId60DaysAfterEndDate(base.TreeRule):
|
|
|
3063
3069
|
)
|
|
3064
3070
|
if end_date > partial_date_sixty_days:
|
|
3065
3071
|
has_recent_tenure = True
|
|
3066
|
-
if not has_recent_tenure:
|
|
3072
|
+
if not has_recent_tenure and office_holder_person_elem is not None:
|
|
3067
3073
|
info_message = (
|
|
3068
3074
|
"All officeholder tenures ended more than 60 days ago. "
|
|
3069
|
-
"Therefore, you can remove the person and the
|
|
3070
|
-
"officeholder tenures from the feed."
|
|
3075
|
+
"Therefore, you can remove the person and the "
|
|
3076
|
+
"related officeholder tenures from the feed."
|
|
3077
|
+
)
|
|
3078
|
+
info_log.append(
|
|
3079
|
+
loggers.LogEntry(info_message, [office_holder_person_elem])
|
|
3071
3080
|
)
|
|
3072
|
-
info_log.append(loggers.LogEntry(info_message, [person_id]))
|
|
3073
3081
|
else:
|
|
3074
3082
|
for office in offices:
|
|
3075
3083
|
person_id = office.find("OfficeHolderPersonIds").text
|
|
@@ -3481,9 +3489,6 @@ class MissingFieldsInfo(base.MissingFieldRule):
|
|
|
3481
3489
|
|
|
3482
3490
|
def element_field_mapping(self):
|
|
3483
3491
|
return {
|
|
3484
|
-
"Office": [
|
|
3485
|
-
"ElectoralDistrictId",
|
|
3486
|
-
],
|
|
3487
3492
|
}
|
|
3488
3493
|
|
|
3489
3494
|
|
|
@@ -4503,10 +4508,20 @@ class UnreferencedEntitiesOfficeholders(UnreferencedEntitiesBase):
|
|
|
4503
4508
|
"""
|
|
4504
4509
|
|
|
4505
4510
|
def __init__(self, election_tree, schema_tree, **kwargs):
|
|
4511
|
+
office_holder_tenure_collection = self.get_elements_by_class(
|
|
4512
|
+
election_tree, "OfficeHolderTenure"
|
|
4513
|
+
)
|
|
4514
|
+
is_post_office_split = False
|
|
4515
|
+
if office_holder_tenure_collection:
|
|
4516
|
+
is_post_office_split = True
|
|
4506
4517
|
super(UnreferencedEntitiesOfficeholders, self).__init__(
|
|
4507
4518
|
election_tree,
|
|
4508
4519
|
schema_tree,
|
|
4509
|
-
|
|
4520
|
+
(
|
|
4521
|
+
frozenset(["OfficeHolderTenure", "Leadership"])
|
|
4522
|
+
if is_post_office_split
|
|
4523
|
+
else frozenset(["Office", "Leadership"])
|
|
4524
|
+
),
|
|
4510
4525
|
frozenset(["Party"]),
|
|
4511
4526
|
**kwargs,
|
|
4512
4527
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|