csvpath 0.0.475__tar.gz → 0.0.476__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.475 → csvpath-0.0.476}/PKG-INFO +1 -1
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/csvpath.py +4 -3
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/csvpaths.py +13 -2
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/function_factory.py +3 -1
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/testing/debug.py +26 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/config.py +17 -10
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/printer.py +26 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/pyproject.toml +1 -1
- {csvpath-0.0.475 → csvpath-0.0.476}/LICENSE +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/README.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/config/config.ini +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/__init__.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/managers/__init__.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/managers/csvpaths_manager.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/managers/file_manager.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/managers/result.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/managers/results_manager.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/__init__.py +0 -0
- {csvpath-0.0.475/csvpath/scanning → csvpath-0.0.476/csvpath/matching/functions}/__init__.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/all.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/andf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/any.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/between.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/empty.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/exists.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/inf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/no.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/notf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/orf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/boolean/yes.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/count.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/count_headers.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/count_lines.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/count_scans.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/counter.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/every.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/has_matches.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/increment.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/tally.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/counting/total_lines.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/dates/datef.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/dates/now.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/function.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/function_finder.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/function_focus.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/collect.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/empty_stack.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/end.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/header_name.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/header_names_mismatch.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/headers.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/mismatch.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/replace.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/headers/reset_headers.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/advance.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/after_blank.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/dups.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/first.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/first_line.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/last.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/lines/stop.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/above.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/add.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/divide.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/equals.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/mod.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/multiply.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/round.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/subtract.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/math/sum.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/misc/importf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/misc/intf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/misc/nonef.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/misc/random.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/print/jinjaf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/print/print_line.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/print/print_queue.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/print/printf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/print/table.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/stats/minf.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/stats/percent.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/stats/percent_unique.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/stats/stdev.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/concat.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/length.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/lower.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/metaphone.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/num.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/regex.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/starts_with.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/strip.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/substring.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/strings/upper.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/validation.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/validity/fail.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/validity/failed.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/variables/get.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/variables/pushpop.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/variables/put.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/variables/track.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/functions/variables/variables.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/lark_parser.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/lark_transformer.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/matcher.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/__init__.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/equality.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/expression.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/header.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/matchable.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/qualified.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/reference.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/term.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/productions/variable.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/util/exceptions.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/util/expression_encoder.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/util/expression_utility.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/util/lark_print_parser.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/matching/util/print_parser.py +0 -0
- {csvpath-0.0.475/csvpath/matching/functions → csvpath-0.0.476/csvpath/scanning}/__init__.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/scanning/exceptions.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/scanning/parser.out +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/scanning/parsetab.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/scanning/scanner.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/scanning/scanning_lexer.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/cache.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/config_exception.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/error.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/exceptions.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/last_line_stats.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/line_counter.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/line_monitor.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/log_utility.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/csvpath/util/metadata_parser.py +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/asbool.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/assignment.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/config.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/examples.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/files.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/above.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/advance.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/after_blank.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/all.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/andor.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/any.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/average.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/between.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/collect.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/correlate.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/count.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/count_headers.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/counter.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/date.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/empty.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/empty_stack.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/end.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/every.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/fail.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/first.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/get.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/has_dups.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/has_matches.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/header.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/header_name.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/header_names_mismatch.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/implementing_functions.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/import.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/in.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/increment.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/jinja.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/last.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/line_number.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/max.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/metaphone.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/mismatch.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/no.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/not.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/now.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/percent_unique.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/pop.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/print.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/print_line.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/print_queue.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/regex.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/replace.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/reset_headers.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/stdev.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/stop.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/string_functions.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/subtract.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/sum.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/tally.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/total_lines.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/track.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/variables.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions/variables_and_headers.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/functions.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/grammar.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/headers.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/images/logo-wordmark-white-trimmed.png +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/paths.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/qualifiers.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/references.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/terms.md +0 -0
- {csvpath-0.0.475 → csvpath-0.0.476}/docs/variables.md +0 -0
|
@@ -232,11 +232,12 @@ class CsvPath(CsvPathPublic, ErrorCollector): # pylint: disable=R0902, R0904
|
|
|
232
232
|
#
|
|
233
233
|
# the config.ini file loaded as a ConfigParser instance
|
|
234
234
|
#
|
|
235
|
-
# we're moving this to a property can set up there. we
|
|
236
235
|
# definitely do not want this coming from CsvPaths because
|
|
237
236
|
# we want to be able to override config.ini specifically for
|
|
238
|
-
# this instance, if needed
|
|
239
|
-
|
|
237
|
+
# this instance, if needed; however, we do want to be able
|
|
238
|
+
# to pass in a config object that has been configured in some
|
|
239
|
+
# way.
|
|
240
|
+
self._config = config
|
|
240
241
|
#
|
|
241
242
|
# there are two logger components one for CsvPath and one for CsvPaths.
|
|
242
243
|
# the default levels are set in config.ini. to change the levels pass LogUtility
|
|
@@ -122,7 +122,13 @@ class CsvPaths(CsvPathsPublic, CsvPathsCoordinator):
|
|
|
122
122
|
# pylint: disable=too-many-instance-attributes
|
|
123
123
|
|
|
124
124
|
def __init__(
|
|
125
|
-
self,
|
|
125
|
+
self,
|
|
126
|
+
*,
|
|
127
|
+
delimiter=",",
|
|
128
|
+
quotechar='"',
|
|
129
|
+
skip_blank_lines=True,
|
|
130
|
+
print_default=True,
|
|
131
|
+
config: Config = None,
|
|
126
132
|
):
|
|
127
133
|
self.paths_manager = PathsManager(csvpaths=self)
|
|
128
134
|
self.file_manager = FileManager(csvpaths=self)
|
|
@@ -132,7 +138,7 @@ class CsvPaths(CsvPathsPublic, CsvPathsCoordinator):
|
|
|
132
138
|
self.quotechar = quotechar
|
|
133
139
|
self.skip_blank_lines = skip_blank_lines
|
|
134
140
|
self.current_matcher: CsvPath = None
|
|
135
|
-
self._config = Config()
|
|
141
|
+
self._config = Config() if config is None else config
|
|
136
142
|
self.logger = LogUtility.logger(self)
|
|
137
143
|
self.logger.info("initialized CsvPaths")
|
|
138
144
|
self._errors = []
|
|
@@ -155,6 +161,11 @@ class CsvPaths(CsvPathsPublic, CsvPathsCoordinator):
|
|
|
155
161
|
delimiter=self.delimiter,
|
|
156
162
|
quotechar=self.quotechar,
|
|
157
163
|
skip_blank_lines=self.skip_blank_lines,
|
|
164
|
+
#
|
|
165
|
+
# in the usual case we don't want csvpaths and its csvpath children
|
|
166
|
+
# to share the same config. sharing doesn't offer much. the flexibility
|
|
167
|
+
# of having separate configs is valuable.
|
|
168
|
+
#
|
|
158
169
|
config=None,
|
|
159
170
|
print_default=self.print_default,
|
|
160
171
|
)
|
|
@@ -80,7 +80,7 @@ from .misc.random import Random
|
|
|
80
80
|
from .misc.nonef import Nonef
|
|
81
81
|
from .misc.intf import Int
|
|
82
82
|
from .misc.importf import Import
|
|
83
|
-
from .testing.debug import Debug, BriefStackTrace, VoteStack, DoWhenStack
|
|
83
|
+
from .testing.debug import Debug, BriefStackTrace, VoteStack, DoWhenStack, Log
|
|
84
84
|
from .validity.failed import Failed
|
|
85
85
|
from .validity.fail import Fail, FailAll
|
|
86
86
|
|
|
@@ -350,6 +350,8 @@ class FunctionFactory:
|
|
|
350
350
|
f = Put(matcher, name, child)
|
|
351
351
|
elif name == "debug":
|
|
352
352
|
f = Debug(matcher, name, child)
|
|
353
|
+
elif name == "log":
|
|
354
|
+
f = Log(matcher, name, child)
|
|
353
355
|
elif name == "brief_stack_trace":
|
|
354
356
|
f = BriefStackTrace(matcher, name, child)
|
|
355
357
|
elif name == "vote_stack":
|
|
@@ -6,6 +6,32 @@ from csvpath.matching.util.expression_utility import ExpressionUtility
|
|
|
6
6
|
from csvpath.matching.productions import Equality
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
class Log(SideEffect):
|
|
10
|
+
"""logs a msg at a log level, defaulting to info"""
|
|
11
|
+
|
|
12
|
+
def check_valid(self) -> None:
|
|
13
|
+
self.validate_one_or_two_args()
|
|
14
|
+
super().check_valid()
|
|
15
|
+
|
|
16
|
+
def _produce_value(self, skip=None) -> None:
|
|
17
|
+
self.value = self.matches(skip=skip)
|
|
18
|
+
|
|
19
|
+
def _decide_match(self, skip=None) -> None:
|
|
20
|
+
msg = self._value_one(skip=skip)
|
|
21
|
+
level = self._value_two(skip=skip)
|
|
22
|
+
if level in [None, "info"]:
|
|
23
|
+
self.matcher.csvpath.logger.info(msg)
|
|
24
|
+
elif level == "debug":
|
|
25
|
+
self.matcher.csvpath.logger.debug(msg)
|
|
26
|
+
elif level in ["warn", "warning"]:
|
|
27
|
+
self.matcher.csvpath.logger.warning(msg)
|
|
28
|
+
elif level == "error":
|
|
29
|
+
self.matcher.csvpath.logger.error(msg)
|
|
30
|
+
else:
|
|
31
|
+
self.matcher.csvpath.logger.info(msg)
|
|
32
|
+
self.match = self.default_match()
|
|
33
|
+
|
|
34
|
+
|
|
9
35
|
class Debug(SideEffect):
|
|
10
36
|
"""sets the logging level"""
|
|
11
37
|
|
|
@@ -85,8 +85,8 @@ class Config:
|
|
|
85
85
|
return self._load
|
|
86
86
|
|
|
87
87
|
@load.setter
|
|
88
|
-
def load(self,
|
|
89
|
-
self._load =
|
|
88
|
+
def load(self, lo: bool) -> None:
|
|
89
|
+
self._load = lo
|
|
90
90
|
|
|
91
91
|
def reload(self):
|
|
92
92
|
self._config = RawConfigParser()
|
|
@@ -114,19 +114,23 @@ class Config:
|
|
|
114
114
|
ret = s
|
|
115
115
|
return ret
|
|
116
116
|
except KeyError:
|
|
117
|
-
|
|
118
|
-
f"Check config at {self.config_path} for [{section}][{name}]"
|
|
117
|
+
print(
|
|
118
|
+
f"WARNING: Check config at {self.config_path} for [{section}][{name}]"
|
|
119
119
|
)
|
|
120
120
|
|
|
121
|
+
def save_config(self) -> None:
|
|
122
|
+
with open(self.configpath, "w") as f:
|
|
123
|
+
self._config.write(f)
|
|
124
|
+
|
|
121
125
|
def _create_default_config(self) -> None:
|
|
122
126
|
directory = ""
|
|
123
|
-
|
|
127
|
+
name = ""
|
|
124
128
|
if self._configpath is None or self._configpath.strip() == "":
|
|
125
|
-
raise
|
|
129
|
+
raise ConfigurationException("Config path cannot be None")
|
|
126
130
|
if self._configpath.find(os.sep) > 0:
|
|
127
131
|
s = self._configpath.rfind(os.sep)
|
|
128
132
|
directory = self._configpath[0:s]
|
|
129
|
-
name = self._configpath[s+1:]
|
|
133
|
+
name = self._configpath[s + 1 :]
|
|
130
134
|
if directory != "":
|
|
131
135
|
if not path.exists(directory):
|
|
132
136
|
os.makedirs(directory)
|
|
@@ -189,7 +193,9 @@ path =
|
|
|
189
193
|
|
|
190
194
|
def _load_config(self, norecurse=False):
|
|
191
195
|
if self._load is False:
|
|
192
|
-
print(
|
|
196
|
+
print(
|
|
197
|
+
"WARNING: _load_config called on a config instance that is set to not load"
|
|
198
|
+
)
|
|
193
199
|
return
|
|
194
200
|
self._assure_config_file_path()
|
|
195
201
|
#
|
|
@@ -218,9 +224,10 @@ path =
|
|
|
218
224
|
# not blowing up when absent seems reasonable.
|
|
219
225
|
try:
|
|
220
226
|
self.function_imports = self._get(Sections.FUNCTIONS.value, "imports")
|
|
221
|
-
print(f"config fuc im: {self.function_imports}")
|
|
222
227
|
except Exception:
|
|
223
|
-
print(
|
|
228
|
+
print(
|
|
229
|
+
"WARNING: config cannot load [functions][imports] from {self.configpath}"
|
|
230
|
+
)
|
|
224
231
|
pass
|
|
225
232
|
# likewise caching.
|
|
226
233
|
try:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
import sys
|
|
3
|
+
from .config_exception import ConfigurationException
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class Printer(ABC):
|
|
@@ -75,3 +76,28 @@ class TestPrinter(Printer):
|
|
|
75
76
|
|
|
76
77
|
def print_to(self, name: str, string: str) -> None:
|
|
77
78
|
self.lines.append(string)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class LogPrinter(StdOutPrinter):
|
|
82
|
+
"""logs to info by default"""
|
|
83
|
+
|
|
84
|
+
def __init__(self, logger):
|
|
85
|
+
self._logger = logger
|
|
86
|
+
if logger is None:
|
|
87
|
+
raise ConfigurationException("Logger cannot be None")
|
|
88
|
+
super().__init__()
|
|
89
|
+
|
|
90
|
+
def print_to(self, name: str, msg: str) -> None:
|
|
91
|
+
self._count += 1
|
|
92
|
+
if name in ["info", None]:
|
|
93
|
+
self._logger.info(msg)
|
|
94
|
+
elif name == "debug":
|
|
95
|
+
self._logger.debug(msg)
|
|
96
|
+
elif name in ["warn", "warning"]:
|
|
97
|
+
self._logger.warning(msg)
|
|
98
|
+
elif name == "error":
|
|
99
|
+
self._logger.error(msg)
|
|
100
|
+
else:
|
|
101
|
+
self._logger.info(msg)
|
|
102
|
+
|
|
103
|
+
self._last_line = msg
|
|
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.475 → csvpath-0.0.476}/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
|
|
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.475 → csvpath-0.0.476}/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
|