csvpath 0.0.474__tar.gz → 0.0.475__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.474 → csvpath-0.0.475}/PKG-INFO +1 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/config/config.ini +1 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/csvpath.py +1 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/csvpaths.py +1 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/function_finder.py +1 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/config.py +81 -36
- {csvpath-0.0.474 → csvpath-0.0.475}/pyproject.toml +1 -1
- csvpath-0.0.474/config/imports.txt +0 -1
- {csvpath-0.0.474 → csvpath-0.0.475}/LICENSE +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/README.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/managers/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/managers/csvpaths_manager.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/managers/file_manager.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/managers/result.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/managers/results_manager.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/all.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/andf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/any.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/between.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/empty.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/exists.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/inf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/no.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/notf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/orf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/boolean/yes.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/count.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/count_headers.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/count_lines.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/count_scans.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/counter.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/every.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/has_matches.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/increment.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/tally.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/counting/total_lines.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/dates/datef.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/dates/now.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/function.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/function_factory.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/function_focus.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/collect.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/empty_stack.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/end.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/header_name.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/header_names_mismatch.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/headers.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/mismatch.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/replace.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/headers/reset_headers.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/advance.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/after_blank.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/dups.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/first.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/first_line.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/last.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/lines/stop.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/above.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/add.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/divide.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/equals.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/mod.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/multiply.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/round.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/subtract.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/math/sum.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/misc/importf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/misc/intf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/misc/nonef.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/misc/random.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/print/jinjaf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/print/print_line.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/print/print_queue.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/print/printf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/print/table.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/stats/minf.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/stats/percent.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/stats/percent_unique.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/stats/stdev.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/concat.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/length.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/lower.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/metaphone.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/num.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/regex.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/starts_with.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/strip.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/substring.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/strings/upper.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/testing/debug.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/validation.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/validity/fail.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/validity/failed.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/variables/get.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/variables/pushpop.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/variables/put.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/variables/track.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/functions/variables/variables.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/lark_parser.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/lark_transformer.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/matcher.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/equality.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/expression.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/header.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/matchable.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/qualified.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/reference.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/term.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/productions/variable.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/util/exceptions.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/util/expression_encoder.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/util/expression_utility.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/util/lark_print_parser.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/matching/util/print_parser.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/__init__.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/exceptions.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/parser.out +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/parsetab.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/scanner.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/scanning/scanning_lexer.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/cache.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/config_exception.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/error.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/exceptions.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/last_line_stats.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/line_counter.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/line_monitor.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/log_utility.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/metadata_parser.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/csvpath/util/printer.py +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/asbool.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/assignment.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/config.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/examples.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/files.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/above.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/advance.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/after_blank.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/all.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/andor.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/any.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/average.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/between.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/collect.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/correlate.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/count.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/count_headers.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/counter.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/date.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/empty.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/empty_stack.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/end.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/every.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/fail.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/first.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/get.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/has_dups.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/has_matches.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/header.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/header_name.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/header_names_mismatch.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/implementing_functions.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/import.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/in.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/increment.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/jinja.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/last.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/line_number.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/max.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/metaphone.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/mismatch.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/no.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/not.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/now.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/percent_unique.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/pop.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/print.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/print_line.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/print_queue.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/regex.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/replace.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/reset_headers.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/stdev.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/stop.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/string_functions.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/subtract.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/sum.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/tally.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/total_lines.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/track.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/variables.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions/variables_and_headers.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/functions.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/grammar.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/headers.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/images/logo-wordmark-white-trimmed.png +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/paths.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/qualifiers.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/references.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/terms.md +0 -0
- {csvpath-0.0.474 → csvpath-0.0.475}/docs/variables.md +0 -0
|
@@ -318,7 +318,7 @@ class CsvPath(CsvPathPublic, ErrorCollector): # pylint: disable=R0902, R0904
|
|
|
318
318
|
@property
|
|
319
319
|
def config(self) -> Config: # pylint: disable=C0116
|
|
320
320
|
if not self._config:
|
|
321
|
-
self._config = Config(
|
|
321
|
+
self._config = Config()
|
|
322
322
|
return self._config
|
|
323
323
|
|
|
324
324
|
def has_errors(self) -> bool: # pylint: disable=C0116
|
|
@@ -132,7 +132,7 @@ class CsvPaths(CsvPathsPublic, CsvPathsCoordinator):
|
|
|
132
132
|
self.quotechar = quotechar
|
|
133
133
|
self.skip_blank_lines = skip_blank_lines
|
|
134
134
|
self.current_matcher: CsvPath = None
|
|
135
|
-
self._config = Config(
|
|
135
|
+
self._config = Config()
|
|
136
136
|
self.logger = LogUtility.logger(self)
|
|
137
137
|
self.logger.info("initialized CsvPaths")
|
|
138
138
|
self._errors = []
|
|
@@ -21,7 +21,7 @@ class FunctionFinder:
|
|
|
21
21
|
return
|
|
22
22
|
if not os.path.exists(path):
|
|
23
23
|
matcher.csvpath.logger.error(
|
|
24
|
-
"
|
|
24
|
+
f"[functions][imports] path in {config.configpath} does not exist"
|
|
25
25
|
)
|
|
26
26
|
return
|
|
27
27
|
with open(path, "r") as file:
|
|
@@ -43,6 +43,7 @@ class Sections(Enum):
|
|
|
43
43
|
ERRORS = "errors"
|
|
44
44
|
LOGGING = "logging"
|
|
45
45
|
FUNCTIONS = "functions"
|
|
46
|
+
CACHE = "cache"
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
class Config:
|
|
@@ -51,22 +52,45 @@ class Config:
|
|
|
51
52
|
- set a CSVPATH_CONFIG_FILE env var
|
|
52
53
|
- create a Config instance set its CONFIG member and call reload
|
|
53
54
|
- or set Config.CONFIG and reload to reset all instances w/o own specific settings
|
|
55
|
+
Also, you can pass Config(load=False) to give you the opportunity to set some/all
|
|
56
|
+
properties programmatically.
|
|
54
57
|
"""
|
|
55
58
|
|
|
56
59
|
CONFIG: str = "config/config.ini"
|
|
57
60
|
CSVPATH_CONFIG_FILE_ENV: str = "CSVPATH_CONFIG_PATH"
|
|
58
61
|
|
|
59
|
-
def __init__(self,
|
|
60
|
-
self.
|
|
62
|
+
def __init__(self, *, load=True):
|
|
63
|
+
self.load = load
|
|
64
|
+
self._cache_dir_path = None
|
|
65
|
+
self._function_imports = None
|
|
66
|
+
self._csvpath_file_extensions = None
|
|
67
|
+
self._csv_file_extensions = None
|
|
68
|
+
self._csvpath_errors_policy = None
|
|
69
|
+
self._csvpaths_errors_policy = None
|
|
70
|
+
self._csvpath_log_level = None
|
|
71
|
+
self._csvpaths_log_level = None
|
|
72
|
+
self._log_file = None
|
|
73
|
+
self._log_files_to_keep = None
|
|
74
|
+
self._log_file_size = None
|
|
61
75
|
self._config = RawConfigParser()
|
|
62
76
|
self.log_file_handler = None
|
|
63
77
|
self._configpath = environ.get(Config.CSVPATH_CONFIG_FILE_ENV)
|
|
64
78
|
if self._configpath is None:
|
|
65
79
|
self._configpath = Config.CONFIG
|
|
66
|
-
self.
|
|
80
|
+
if self.load:
|
|
81
|
+
self._load_config()
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def load(self) -> bool:
|
|
85
|
+
return self._load
|
|
86
|
+
|
|
87
|
+
@load.setter
|
|
88
|
+
def load(self, l:bool) -> None:
|
|
89
|
+
self._load = l
|
|
67
90
|
|
|
68
91
|
def reload(self):
|
|
69
92
|
self._config = RawConfigParser()
|
|
93
|
+
self._load = True
|
|
70
94
|
self._load_config()
|
|
71
95
|
|
|
72
96
|
def set_config_path_and_reload(self, path: str) -> None:
|
|
@@ -95,10 +119,19 @@ class Config:
|
|
|
95
119
|
)
|
|
96
120
|
|
|
97
121
|
def _create_default_config(self) -> None:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
122
|
+
directory = ""
|
|
123
|
+
file = ""
|
|
124
|
+
if self._configpath is None or self._configpath.strip() == "":
|
|
125
|
+
raise ConfiguationException("Config path cannot be None")
|
|
126
|
+
if self._configpath.find(os.sep) > 0:
|
|
127
|
+
s = self._configpath.rfind(os.sep)
|
|
128
|
+
directory = self._configpath[0:s]
|
|
129
|
+
name = self._configpath[s+1:]
|
|
130
|
+
if directory != "":
|
|
131
|
+
if not path.exists(directory):
|
|
132
|
+
os.makedirs(directory)
|
|
133
|
+
with open(self._configpath, "w") as file:
|
|
134
|
+
c = """
|
|
102
135
|
[csvpath_files]
|
|
103
136
|
extensions = txt, csvpath, csvpaths
|
|
104
137
|
[csv_files]
|
|
@@ -114,20 +147,25 @@ log_files_to_keep = 100
|
|
|
114
147
|
log_file_size = 52428800
|
|
115
148
|
[config]
|
|
116
149
|
path =
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
[functions]
|
|
151
|
+
imports =
|
|
152
|
+
[cache]
|
|
153
|
+
path =
|
|
154
|
+
"""
|
|
155
|
+
file.write(c)
|
|
156
|
+
print(f"Created a default config file at {directory} with name {name}.")
|
|
120
157
|
print("If you want your config to be somewhere else remember to")
|
|
121
158
|
print("update the path in the default config.ini")
|
|
122
159
|
|
|
123
160
|
def _assure_logs_path(self) -> None:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
filepath
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
161
|
+
if self.load:
|
|
162
|
+
filepath = self.log_file
|
|
163
|
+
if not filepath or filepath.strip() == "":
|
|
164
|
+
filepath = "logs/csvpath.log"
|
|
165
|
+
self.log_file = filepath
|
|
166
|
+
dirpath = self._get_dir_path(filepath)
|
|
167
|
+
if dirpath and not path.exists(dirpath):
|
|
168
|
+
os.makedirs(dirpath)
|
|
131
169
|
|
|
132
170
|
def _get_dir_path(self, filepath):
|
|
133
171
|
if filepath.find(os.sep) > -1:
|
|
@@ -136,20 +174,23 @@ path =
|
|
|
136
174
|
return None
|
|
137
175
|
|
|
138
176
|
def _assure_cache_path(self) -> None:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"No cache path available. Check config.ini [cache][path]."
|
|
145
|
-
)
|
|
177
|
+
if self.load:
|
|
178
|
+
if self.cache_dir_path is None or self.cache_dir_path.strip() == "":
|
|
179
|
+
self.cache_dir_path = "cache"
|
|
180
|
+
if not path.exists(self.cache_dir_path):
|
|
181
|
+
os.makedirs(self.cache_dir_path)
|
|
146
182
|
|
|
147
183
|
def _assure_config_file_path(self) -> None:
|
|
148
|
-
if
|
|
149
|
-
self._configpath
|
|
150
|
-
|
|
184
|
+
if self.load:
|
|
185
|
+
if not self._configpath or self._configpath.strip() == "":
|
|
186
|
+
self._configpath = Config.CONFIG
|
|
187
|
+
if not os.path.isfile(self._configpath):
|
|
188
|
+
self._create_default_config()
|
|
151
189
|
|
|
152
190
|
def _load_config(self, norecurse=False):
|
|
191
|
+
if self._load is False:
|
|
192
|
+
print("WARNING: _load_config called on a config instance that is set to not load")
|
|
193
|
+
return
|
|
153
194
|
self._assure_config_file_path()
|
|
154
195
|
#
|
|
155
196
|
#
|
|
@@ -173,13 +214,19 @@ path =
|
|
|
173
214
|
self.log_file_size = self._get(
|
|
174
215
|
Sections.LOGGING.value, LogFile.LOG_FILE_SIZE.value
|
|
175
216
|
)
|
|
176
|
-
#
|
|
177
217
|
# path to external functions list. external functions are very optional.
|
|
178
218
|
# not blowing up when absent seems reasonable.
|
|
179
|
-
#
|
|
180
219
|
try:
|
|
181
220
|
self.function_imports = self._get(Sections.FUNCTIONS.value, "imports")
|
|
221
|
+
print(f"config fuc im: {self.function_imports}")
|
|
222
|
+
except Exception:
|
|
223
|
+
print("WARNING: config cannot load [functions][imports] from {self.configpath}")
|
|
224
|
+
pass
|
|
225
|
+
# likewise caching.
|
|
226
|
+
try:
|
|
227
|
+
self.cache_dir_path = self._get(Sections.CACHE.value, "path")
|
|
182
228
|
except Exception:
|
|
229
|
+
print("WARNING: config cannot load [cache][path] from {self.configpath}")
|
|
183
230
|
pass
|
|
184
231
|
#
|
|
185
232
|
# reload if another config path is set
|
|
@@ -284,13 +331,11 @@ path =
|
|
|
284
331
|
|
|
285
332
|
@property
|
|
286
333
|
def cache_dir_path(self) -> str:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
self._config.set("cache", "path", path)
|
|
293
|
-
return path
|
|
334
|
+
return self._cache_dir_path
|
|
335
|
+
|
|
336
|
+
@cache_dir_path.setter
|
|
337
|
+
def cache_dir_path(self, p) -> None:
|
|
338
|
+
self._cache_dir_path = p
|
|
294
339
|
|
|
295
340
|
@property
|
|
296
341
|
def function_imports(self) -> str:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from csvpath.matching.functions.boolean.yes import Yes as sure
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.474 → csvpath-0.0.475}/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
|
|
File without changes
|
|
File without changes
|
{csvpath-0.0.474 → csvpath-0.0.475}/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
|