MCPcopy
hub / github.com/mikf/gallery-dl / get

Method get

gallery_dl/extractor/common.py:816–826  ·  view source on GitHub ↗
(key, default)

Source from the content-addressed store, hash-verified

814 def _get_date_min_max(self, dmin=None, dmax=None):
815 """Retrieve and parse 'date-min' and 'date-max' config values"""
816 def get(key, default):
817 ts = self.config(key, default)
818 if isinstance(ts, str):
819 dt_obj = dt.parse_iso(ts)
820 if dt_obj is dt.NONE:
821 self.log.warning("Unable to parse '%s': Invalid ISO 8601 "
822 "date/time value '%s'", key, ts)
823 ts = default
824 else:
825 ts = int(dt.to_ts(dt_obj))
826 return ts
827 if self.config("date-format"):
828 self.log.error("'date-format' is no longer supported. "
829 "Use ISO 8601 date/time values instead.")

Callers 15

test_null_responseMethod · 0.80
test_getMethod · 0.80
test_setMethod · 0.80
test_setdefaultMethod · 0.80
test_unsetMethod · 0.80
test_applyMethod · 0.80
test_loadMethod · 0.80
test_extractor.pyFile · 0.80
test_categoriesMethod · 0.80
assertCategoriesMethod · 0.80
test_results.pyFile · 0.80
_run_testMethod · 0.80

Calls 2

configMethod · 0.95
warningMethod · 0.45

Tested by 15

test_null_responseMethod · 0.64
test_getMethod · 0.64
test_setMethod · 0.64
test_setdefaultMethod · 0.64
test_unsetMethod · 0.64
test_applyMethod · 0.64
test_loadMethod · 0.64
test_categoriesMethod · 0.64
assertCategoriesMethod · 0.64
_run_testMethod · 0.64
_update_contentMethod · 0.64
result_categoriesFunction · 0.64