csvpath 0.0.458__tar.gz → 0.0.460__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.
- {csvpath-0.0.458 → csvpath-0.0.460}/PKG-INFO +1 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/notf.py +1 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/function_factory.py +7 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/stop.py +1 -1
- csvpath-0.0.460/csvpath/matching/functions/misc/debug.py +73 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/pushpop.py +2 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/print/printf.py +12 -9
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/lark_transformer.py +1 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/matcher.py +13 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/equality.py +1 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/header.py +3 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/matchable.py +1 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/qualified.py +9 -4
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/util/print_parser.py +1 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/printer.py +19 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/pyproject.toml +1 -1
- {csvpath-0.0.458 → csvpath-0.0.460}/LICENSE +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/README.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/config/config.ini +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/csvpath.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/csvpaths.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/managers/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/managers/csvpath_result.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/managers/csvpaths_manager.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/managers/files_manager.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/managers/results_manager.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/all.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/andf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/any.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/between.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/empty.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/exists.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/inf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/no.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/orf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/boolean/yes.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/count.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/count_headers.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/count_lines.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/count_scans.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/every.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/increment.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/tally.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/counting/total_lines.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/function.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/function_focus.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/end.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/header_name.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/header_names_mismatch.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/headers.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/mismatch.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/reset_headers.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/advance.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/after_blank.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/dups.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/first.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/first_line.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/lines/last.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/above.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/add.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/divide.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/equals.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/mod.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/multiply.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/round.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/subtract.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/math/sum.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/collect.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/datef.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/get.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/importf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/intf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/nonef.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/now.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/random.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/regex.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/replace.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/track.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/misc/variables.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/print/jinjaf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/print/print_line.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/print/print_queue.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/stats/correlate.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/stats/minf.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/stats/percent.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/stats/percent_unique.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/stats/stdev.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/concat.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/length.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/lower.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/metaphone.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/starts_with.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/strip.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/substring.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/strings/upper.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/validation.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/validity/fail.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/validity/failed.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/lark_parser.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/expression.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/reference.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/term.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/productions/variable.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/util/exceptions.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/util/expression_encoder.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/util/expression_utility.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/util/lark_print_parser.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/__init__.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/exceptions.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/parser.out +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/parsetab.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/scanner.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/scanning/scanning_lexer.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/config.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/config_exception.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/error.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/exceptions.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/last_line_stats.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/line_monitor.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/log_utility.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/csvpath/util/metadata_parser.py +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/asbool.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/assignment.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/config.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/examples.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/files.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/above.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/advance.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/after_blank.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/all.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/andor.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/any.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/average.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/between.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/collect.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/correlate.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/count.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/count_headers.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/date.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/empty.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/end.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/every.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/fail.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/first.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/get.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/has_dups.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/header.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/header_name.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/header_names_mismatch.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/implementing_functions.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/import.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/in.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/increment.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/jinja.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/last.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/line_number.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/max.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/metaphone.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/mismatch.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/no.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/not.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/now.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/percent_unique.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/pop.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/print.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/print_line.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/print_queue.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/regex.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/replace.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/reset_headers.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/stdev.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/stop.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/string_functions.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/subtract.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/sum.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/tally.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/total_lines.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/track.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/variables.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions/variables_and_headers.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/functions.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/grammar.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/headers.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/images/logo-wordmark-white-trimmed.png +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/paths.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/qualifiers.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/references.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/terms.md +0 -0
- {csvpath-0.0.458 → csvpath-0.0.460}/docs/variables.md +0 -0
|
@@ -72,6 +72,7 @@ from .misc.intf import Int
|
|
|
72
72
|
from .misc.get import Get
|
|
73
73
|
from .misc.track import Track
|
|
74
74
|
from .misc.importf import Import
|
|
75
|
+
from .misc.debug import Debug, BriefStackTrace, VoteStack
|
|
75
76
|
from .validity.failed import Failed
|
|
76
77
|
from .validity.fail import Fail
|
|
77
78
|
|
|
@@ -323,6 +324,12 @@ class FunctionFactory:
|
|
|
323
324
|
f = Between(matcher, name, child)
|
|
324
325
|
elif name == "get":
|
|
325
326
|
f = Get(matcher, name, child)
|
|
327
|
+
elif name == "debug":
|
|
328
|
+
f = Debug(matcher, name, child)
|
|
329
|
+
elif name == "brief_stack_trace":
|
|
330
|
+
f = BriefStackTrace(matcher, name, child)
|
|
331
|
+
elif name == "vote_stack":
|
|
332
|
+
f = VoteStack(matcher, name, child)
|
|
326
333
|
elif name == "metaphone":
|
|
327
334
|
f = Metaphone(matcher, name, child)
|
|
328
335
|
else:
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# pylint: disable=C0114
|
|
2
|
+
import datetime
|
|
3
|
+
from ..function_focus import SideEffect
|
|
4
|
+
from csvpath.util.log_utility import LogUtility
|
|
5
|
+
from csvpath.matching.util.expression_utility import ExpressionUtility
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Debug(SideEffect):
|
|
9
|
+
"""sets the logging level"""
|
|
10
|
+
|
|
11
|
+
def check_valid(self) -> None:
|
|
12
|
+
self.validate_zero_or_one_arg()
|
|
13
|
+
super().check_valid()
|
|
14
|
+
|
|
15
|
+
def _produce_value(self, skip=None) -> None:
|
|
16
|
+
self.value = self.matches(skip=skip)
|
|
17
|
+
|
|
18
|
+
def _decide_match(self, skip=None) -> None:
|
|
19
|
+
level = None
|
|
20
|
+
if len(self.children) == 1:
|
|
21
|
+
level = self.children[0].to_value(skip=skip)
|
|
22
|
+
level = f"{level}".strip()
|
|
23
|
+
else:
|
|
24
|
+
level = "debug"
|
|
25
|
+
LogUtility.logger(self.matcher.csvpath, level)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class BriefStackTrace(SideEffect):
|
|
29
|
+
def check_valid(self) -> None:
|
|
30
|
+
self.validate_zero_or_one_arg()
|
|
31
|
+
super().check_valid()
|
|
32
|
+
|
|
33
|
+
def _produce_value(self, skip=None) -> None:
|
|
34
|
+
self.value = self.matches(skip=skip)
|
|
35
|
+
|
|
36
|
+
def _decide_match(self, skip=None) -> None:
|
|
37
|
+
out = None
|
|
38
|
+
if len(self.children) == 1:
|
|
39
|
+
out = self.children[0].to_value(skip=skip)
|
|
40
|
+
out = f"{out}".strip()
|
|
41
|
+
if out not in ["log", "print"]:
|
|
42
|
+
out = "log"
|
|
43
|
+
else:
|
|
44
|
+
out = "log"
|
|
45
|
+
if out == "log":
|
|
46
|
+
LogUtility.log_brief_trace(self.matcher.csvpath.logger)
|
|
47
|
+
else:
|
|
48
|
+
LogUtility.log_brief_trace()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class VoteStack(SideEffect):
|
|
52
|
+
def check_valid(self) -> None:
|
|
53
|
+
self.validate_zero_args()
|
|
54
|
+
super().check_valid()
|
|
55
|
+
|
|
56
|
+
def _produce_value(self, skip=None) -> None:
|
|
57
|
+
# do this first so we get an complete vote tally
|
|
58
|
+
self.matches(skip=skip)
|
|
59
|
+
votes = []
|
|
60
|
+
# we're being evaluated so we should assume our expression hasn't
|
|
61
|
+
# voted yet. while we could be embedded somewhere deep the expectation
|
|
62
|
+
# is that we're the main element of our match component, so we should
|
|
63
|
+
# be able to represent a ~faux vote without causing problems.
|
|
64
|
+
me = ExpressionUtility.get_my_expression(self)
|
|
65
|
+
for e in self.matcher.expressions:
|
|
66
|
+
if e[0] == me:
|
|
67
|
+
votes.append(self.match)
|
|
68
|
+
else:
|
|
69
|
+
votes.append(e[1])
|
|
70
|
+
self.value = votes
|
|
71
|
+
|
|
72
|
+
def _decide_match(self, skip=None) -> None:
|
|
73
|
+
self.match = self.default_match()
|
|
@@ -30,13 +30,16 @@ class Print(SideEffect):
|
|
|
30
30
|
if isinstance(self.children[0], Equality):
|
|
31
31
|
right = self.children[0].right
|
|
32
32
|
if self.do_onchange():
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
right
|
|
33
|
+
if self.do_once():
|
|
34
|
+
v = self.to_value(skip=skip)
|
|
35
|
+
#
|
|
36
|
+
# we intentionally add a single char suffix
|
|
37
|
+
#
|
|
38
|
+
if v[len(v) - 1] == " ":
|
|
39
|
+
v = v[0 : len(v) - 1]
|
|
40
|
+
self.matcher.csvpath.print(f"{v}")
|
|
41
|
+
if right:
|
|
42
|
+
right.matches(skip=skip)
|
|
43
|
+
self._set_has_happened()
|
|
44
|
+
|
|
42
45
|
self.match = True
|
|
@@ -195,6 +195,13 @@ class Matcher: # pylint: disable=R0902
|
|
|
195
195
|
# now ret holds this expression's vote
|
|
196
196
|
#
|
|
197
197
|
pln = self.csvpath.line_monitor.physical_line_number
|
|
198
|
+
self.csvpath.logger.debug(
|
|
199
|
+
"Matcher.matches: ready to adjudicate %s component %s match: ret: %s, failed: %s",
|
|
200
|
+
"AND" if self._AND else "OR",
|
|
201
|
+
str(et[0]),
|
|
202
|
+
ret,
|
|
203
|
+
failed,
|
|
204
|
+
)
|
|
198
205
|
if self._AND:
|
|
199
206
|
if ret is False:
|
|
200
207
|
failed = True
|
|
@@ -208,7 +215,12 @@ class Matcher: # pylint: disable=R0902
|
|
|
208
215
|
# were found, we would respond True; else, False.
|
|
209
216
|
#
|
|
210
217
|
pln = self.csvpath.line_monitor.physical_line_number
|
|
211
|
-
self.csvpath.logger.debug(
|
|
218
|
+
self.csvpath.logger.debug(
|
|
219
|
+
"Matcher.matches: result (AND:%s) for line %s: %s",
|
|
220
|
+
self._AND,
|
|
221
|
+
pln,
|
|
222
|
+
not failed,
|
|
223
|
+
)
|
|
212
224
|
return not failed
|
|
213
225
|
|
|
214
226
|
def check_valid(self) -> None: # pylint: disable=C0116
|
|
@@ -253,6 +253,7 @@ class Equality(Matchable):
|
|
|
253
253
|
)
|
|
254
254
|
else:
|
|
255
255
|
ret = not ret
|
|
256
|
+
|
|
256
257
|
#
|
|
257
258
|
# asbool
|
|
258
259
|
#
|
|
@@ -356,7 +357,6 @@ class Equality(Matchable):
|
|
|
356
357
|
lm = self.left.matches(skip=skip)
|
|
357
358
|
if lm is True:
|
|
358
359
|
b = True
|
|
359
|
-
# print(f"EQuality.do_when: matcher._AND: {self.matcher._AND}, b: {b}")
|
|
360
360
|
if self.matcher._AND is False:
|
|
361
361
|
b = not b
|
|
362
362
|
#
|
|
@@ -50,6 +50,7 @@ class Header(Matchable):
|
|
|
50
50
|
self.value = ExpressionUtility.asbool(ret)
|
|
51
51
|
else:
|
|
52
52
|
self.value = ret
|
|
53
|
+
# print(f"header.to_value: self.value: {self.value}<<<")
|
|
53
54
|
return self.value
|
|
54
55
|
|
|
55
56
|
def matches(self, *, skip=None) -> bool:
|
|
@@ -61,5 +62,6 @@ class Header(Matchable):
|
|
|
61
62
|
v = self.to_value(skip=skip)
|
|
62
63
|
self.match = ExpressionUtility.asbool(v)
|
|
63
64
|
else:
|
|
64
|
-
self.match = v is not None
|
|
65
|
+
self.match = not ExpressionUtility.is_none(v) # v is not None
|
|
66
|
+
# print(f"Header.matches: match? {self.match}")
|
|
65
67
|
return self.match
|
|
@@ -260,6 +260,7 @@ class Qualified:
|
|
|
260
260
|
by adding self to the skip list."""
|
|
261
261
|
es = self.matcher.expressions # pylint: disable=E1101
|
|
262
262
|
for e in es:
|
|
263
|
+
|
|
263
264
|
m = e[1] is self.default_match() or e[0].matches(
|
|
264
265
|
skip=[self]
|
|
265
266
|
) # pylint: disable=E1101
|
|
@@ -284,13 +285,17 @@ class Qualified:
|
|
|
284
285
|
qualified doesn't have the qualification."""
|
|
285
286
|
if not self.onchange:
|
|
286
287
|
return True
|
|
287
|
-
_id = self.get_id() # pylint: disable=E1101
|
|
288
|
+
_id = f"{self.get_id()}_onchange" # pylint: disable=E1101
|
|
288
289
|
v = self.matcher.get_variable(_id) # pylint: disable=E1101
|
|
289
290
|
me = hashlib.sha256(
|
|
290
291
|
f"{self.to_value()}".encode("utf-8") # pylint: disable=E1101
|
|
291
292
|
).hexdigest()
|
|
292
293
|
self.matcher.set_variable(_id, value=me) # pylint: disable=E1101
|
|
293
|
-
|
|
294
|
+
# I think this would be better as an is True/is False test
|
|
295
|
+
# but this works fine
|
|
296
|
+
ret = me != v
|
|
297
|
+
# print(f"qualified.do_onchange: v: {v}, me: {me} == {ret}")
|
|
298
|
+
return ret
|
|
294
299
|
|
|
295
300
|
@property
|
|
296
301
|
def onchange(self) -> bool: # pylint: disable=C0116
|
|
@@ -327,7 +332,7 @@ class Qualified:
|
|
|
327
332
|
#
|
|
328
333
|
# supports ONCE
|
|
329
334
|
#
|
|
330
|
-
_id = self.get_id() # pylint: disable=E1101
|
|
335
|
+
_id = f"{self.get_id()}_once" # pylint: disable=E1101
|
|
331
336
|
v = self.matcher.get_variable(_id, set_if_none=True) # pylint: disable=E1101
|
|
332
337
|
return v
|
|
333
338
|
|
|
@@ -335,6 +340,6 @@ class Qualified:
|
|
|
335
340
|
#
|
|
336
341
|
# supports ONCE
|
|
337
342
|
#
|
|
338
|
-
_id = self.get_id() # pylint: disable=E1101
|
|
343
|
+
_id = f"{self.get_id()}_once" # pylint: disable=E1101
|
|
339
344
|
self.matcher.set_variable(_id, value=False) # pylint: disable=E1101
|
|
340
345
|
# re: E1101: inheritance structure. good point, but not the time to fix it.
|
|
@@ -54,3 +54,22 @@ class StdOutPrinter(Printer):
|
|
|
54
54
|
else:
|
|
55
55
|
print(string)
|
|
56
56
|
self._last_line = string
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class TestPrinter(Printer):
|
|
60
|
+
def __init__(self):
|
|
61
|
+
self.lines = []
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def lines_printed(self) -> int:
|
|
65
|
+
return len(self.lines)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def last_line(self) -> str:
|
|
69
|
+
return self.lines[len(self.lines) - 1] if len(self.lines) > 0 else ""
|
|
70
|
+
|
|
71
|
+
def print(self, string: str) -> None:
|
|
72
|
+
self.print_to(None, string)
|
|
73
|
+
|
|
74
|
+
def print_to(self, name: str, string: str) -> None:
|
|
75
|
+
self.lines.append(string)
|
|
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
|
|
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
|
{csvpath-0.0.458 → csvpath-0.0.460}/csvpath/matching/functions/headers/header_names_mismatch.py
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
{csvpath-0.0.458 → csvpath-0.0.460}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|