civics-cdf-validator 1.64.dev0__tar.gz → 1.64.dev2__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.64.dev0/civics_cdf_validator.egg-info → civics_cdf_validator-1.64.dev2}/PKG-INFO +1 -1
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/rules.py +0 -48
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/version.py +1 -1
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/README.md +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/__init__.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/base.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/loggers.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/office_utils.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/setup.cfg +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/setup.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/stats.py +0 -0
- {civics_cdf_validator-1.64.dev0 → civics_cdf_validator-1.64.dev2}/validator.py +0 -0
|
@@ -368,53 +368,6 @@ class Encoding(base.TreeRule):
|
|
|
368
368
|
raise loggers.ElectionError.from_message("Encoding on file is not UTF-8")
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
class HungarianStyleNotation(base.BaseRule):
|
|
372
|
-
"""Check that element identifiers use Hungarian style notation.
|
|
373
|
-
|
|
374
|
-
Hungarian style notation is used to maintain uniqueness and provide context
|
|
375
|
-
for the identifiers.
|
|
376
|
-
"""
|
|
377
|
-
|
|
378
|
-
# Add a prefix when there is a specific entity in the xml.
|
|
379
|
-
elements_prefix = {
|
|
380
|
-
"BallotMeasureContest": "bmc",
|
|
381
|
-
"BallotMeasureSelection": "bms",
|
|
382
|
-
"BallotStyle": "bs",
|
|
383
|
-
"Candidate": "can",
|
|
384
|
-
"CandidateContest": "cc",
|
|
385
|
-
"CandidateSelection": "cs",
|
|
386
|
-
"Coalition": "coa",
|
|
387
|
-
"ContactInformation": "ci",
|
|
388
|
-
"Hours": "hours",
|
|
389
|
-
"Office": "off",
|
|
390
|
-
"OfficeGroup": "og",
|
|
391
|
-
"Party": "par",
|
|
392
|
-
"PartyContest": "pc",
|
|
393
|
-
"PartySelection": "ps",
|
|
394
|
-
"Person": "per",
|
|
395
|
-
"ReportingDevice": "rd",
|
|
396
|
-
"ReportingUnit": "ru",
|
|
397
|
-
"RetentionContest": "rc",
|
|
398
|
-
"Schedule": "sched",
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
def elements(self):
|
|
402
|
-
return self.elements_prefix.keys()
|
|
403
|
-
|
|
404
|
-
def check(self, element):
|
|
405
|
-
object_id = element.get("objectId")
|
|
406
|
-
tag = self.get_element_class(element)
|
|
407
|
-
if object_id:
|
|
408
|
-
if not object_id.startswith(self.elements_prefix[tag]):
|
|
409
|
-
raise loggers.ElectionInfo.from_message(
|
|
410
|
-
(
|
|
411
|
-
"%s ID %s is not in Hungarian Style Notation. Should start"
|
|
412
|
-
" with %s" % (tag, object_id, self.elements_prefix[tag])
|
|
413
|
-
),
|
|
414
|
-
[element],
|
|
415
|
-
)
|
|
416
|
-
|
|
417
|
-
|
|
418
371
|
class LanguageCode(base.BaseRule):
|
|
419
372
|
"""Check that Text and Uri elements have a valid language code."""
|
|
420
373
|
|
|
@@ -5552,7 +5505,6 @@ COMMON_RULES = (
|
|
|
5552
5505
|
GpUnitOcdId,
|
|
5553
5506
|
GpUnitsCyclesRefsValidation,
|
|
5554
5507
|
GpUnitsHaveInternationalizedName,
|
|
5555
|
-
HungarianStyleNotation,
|
|
5556
5508
|
IndependentPartyName,
|
|
5557
5509
|
LanguageCode,
|
|
5558
5510
|
MissingFieldsError,
|
|
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
|
|
File without changes
|