civics-cdf-validator 1.49.dev12__py3-none-any.whl → 1.49.dev13__py3-none-any.whl
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/rules.py +16 -18
- civics_cdf_validator/version.py +1 -1
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/METADATA +1 -1
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/RECORD +8 -8
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/WHEEL +0 -0
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/entry_points.txt +0 -0
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/licenses/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/top_level.txt +0 -0
civics_cdf_validator/rules.py
CHANGED
|
@@ -4182,34 +4182,32 @@ class ElectionEventDatesAreSequential(base.DateRule):
|
|
|
4182
4182
|
raise loggers.ElectionError(self.error_log)
|
|
4183
4183
|
|
|
4184
4184
|
|
|
4185
|
-
class
|
|
4186
|
-
"""SourceDirPath
|
|
4185
|
+
class SourceDirPathMustBeSetAfterInitialDeliveryDate(base.BaseRule):
|
|
4186
|
+
"""SourceDirPath must be set if any InitialDeliveryDate is in the past."""
|
|
4187
4187
|
|
|
4188
4188
|
def elements(self):
|
|
4189
4189
|
return ["Feed"]
|
|
4190
4190
|
|
|
4191
4191
|
def check(self, element):
|
|
4192
|
-
if
|
|
4192
|
+
if element_has_text(element.find("SourceDirPath")):
|
|
4193
4193
|
return
|
|
4194
4194
|
today = datetime.date.today()
|
|
4195
4195
|
today_partial_date = base.PartialDate(
|
|
4196
4196
|
year=today.year, month=today.month, day=today.day
|
|
4197
4197
|
)
|
|
4198
|
-
initial_deliveries = element.findall(".//InitialDeliveryDate")
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
else None
|
|
4205
|
-
)
|
|
4206
|
-
if initial_delivery_date and initial_delivery_date < today_partial_date:
|
|
4207
|
-
return
|
|
4208
|
-
raise loggers.ElectionWarning.from_message(
|
|
4209
|
-
"SourceDirPath is defined but all initialDeliveryDate are in the"
|
|
4210
|
-
" future.",
|
|
4211
|
-
[element],
|
|
4198
|
+
initial_deliveries = element.findall(".//InitialDeliveryDate") or []
|
|
4199
|
+
for initial_delivery in initial_deliveries:
|
|
4200
|
+
initial_delivery_date = (
|
|
4201
|
+
base.PartialDate.init_partial_date(initial_delivery.text)
|
|
4202
|
+
if element_has_text(initial_delivery)
|
|
4203
|
+
else None
|
|
4212
4204
|
)
|
|
4205
|
+
if initial_delivery_date and initial_delivery_date < today_partial_date:
|
|
4206
|
+
raise loggers.ElectionError.from_message(
|
|
4207
|
+
"SourceDirPath is not set but an InitialDeliveryDate is in the "
|
|
4208
|
+
f"past for feed {element.find('FeedId').text}.",
|
|
4209
|
+
[element],
|
|
4210
|
+
)
|
|
4213
4211
|
|
|
4214
4212
|
|
|
4215
4213
|
class OfficeHolderSubFeedDatesAreSequential(base.DateRule):
|
|
@@ -4790,10 +4788,10 @@ METADATA_RULES = (
|
|
|
4790
4788
|
FeedInactiveDateIsLatestDate,
|
|
4791
4789
|
FeedInactiveDateSetForNonEvergreenFeed,
|
|
4792
4790
|
FeedTypeHasValidFeedLongevity,
|
|
4793
|
-
NoSourceDirPathBeforeInitialDeliveryDate,
|
|
4794
4791
|
OfficeHolderSubFeedDatesAreSequential,
|
|
4795
4792
|
OptionalAndEmpty,
|
|
4796
4793
|
Schema,
|
|
4794
|
+
SourceDirPathMustBeSetAfterInitialDeliveryDate,
|
|
4797
4795
|
SourceDirPathsAreUnique,
|
|
4798
4796
|
UniqueLabel,
|
|
4799
4797
|
# go/keep-sorted end
|
civics_cdf_validator/version.py
CHANGED
{civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/RECORD
RENAMED
|
@@ -3,13 +3,13 @@ civics_cdf_validator/base.py,sha256=5zntjAdAA-bdwYOOStFgUle9LGX_ccelS--thMhUG9A,
|
|
|
3
3
|
civics_cdf_validator/gpunit_rules.py,sha256=Cg-qlOeVKTCQ5qUKYSxbVrrh3tdLt1X5Eg-7uyyR_SY,9487
|
|
4
4
|
civics_cdf_validator/loggers.py,sha256=LS6U9YWzu72V2Q0PwyE9xE03Ul392UAPRnrp2uRBMLA,6923
|
|
5
5
|
civics_cdf_validator/office_utils.py,sha256=aFxcFQZF2oBn0gPXt_kv1LxHGvwzABScT8X5yaYtVLw,2705
|
|
6
|
-
civics_cdf_validator/rules.py,sha256=
|
|
6
|
+
civics_cdf_validator/rules.py,sha256=Ucw1vURByvUoyMVdBUDnzggO15kExbnpsBZU0Wlg-EE,159895
|
|
7
7
|
civics_cdf_validator/stats.py,sha256=YNqv3Khkt_hJxCIunFBRSl23oXqu5gNjCmWMHFbAcSU,3819
|
|
8
8
|
civics_cdf_validator/validator.py,sha256=2nwlFfQ9AmpTaO5n5ekaO845Rm0JPjNF-Il6FJW_50k,12678
|
|
9
|
-
civics_cdf_validator/version.py,sha256=
|
|
10
|
-
civics_cdf_validator-1.49.
|
|
11
|
-
civics_cdf_validator-1.49.
|
|
12
|
-
civics_cdf_validator-1.49.
|
|
13
|
-
civics_cdf_validator-1.49.
|
|
14
|
-
civics_cdf_validator-1.49.
|
|
15
|
-
civics_cdf_validator-1.49.
|
|
9
|
+
civics_cdf_validator/version.py,sha256=VFMdAjvjwr34E1vqDkhcL8mmJWGxF_XUDagoSEfJ11Y,189
|
|
10
|
+
civics_cdf_validator-1.49.dev13.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
11
|
+
civics_cdf_validator-1.49.dev13.dist-info/METADATA,sha256=MBpl8nej6fgkR0c0jy0owtovKInrOYSLDPpp1k8viaw,1009
|
|
12
|
+
civics_cdf_validator-1.49.dev13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
civics_cdf_validator-1.49.dev13.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
|
|
14
|
+
civics_cdf_validator-1.49.dev13.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
|
|
15
|
+
civics_cdf_validator-1.49.dev13.dist-info/RECORD,,
|
{civics_cdf_validator-1.49.dev12.dist-info → civics_cdf_validator-1.49.dev13.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|