MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / from_config

Method from_config

scenedetect/_cli/config.py:137–147  ·  view source on GitHub ↗
(config_value: str, default: "RangeValue")

Source from the content-addressed store, hash-verified

135
136 @staticmethod
137 def from_config(config_value: str, default: "RangeValue") -> "RangeValue":
138 try:
139 return RangeValue(
140 value=int(config_value) if isinstance(default.value, int) else float(config_value),
141 min_val=default.min_val,
142 max_val=default.max_val,
143 )
144 except ValueError as ex:
145 raise OptionParseFailure(
146 f"Value must be between {default.min_val} and {default.max_val}."
147 ) from ex
148
149
150class CropValue(ValidatedValue):

Callers

nothing calls this directly

Calls 2

RangeValueClass · 0.85
OptionParseFailureClass · 0.85

Tested by

no test coverage detected