MCPcopy Create free account
hub / github.com/dashingsoft/pyarmor-webui / _check_arg

Method _check_arg

handler.py:52–60  ·  view source on GitHub ↗
(self, name, value, valids=None, invalids=None, types=None)

Source from the content-addressed store, hash-verified

50 raise RuntimeError('No route for %s', name)
51
52 def _check_arg(self, name, value, valids=None, invalids=None, types=None):
53 if value in (None, ''):
54 raise RuntimeError('Missing argument "%s"' % name)
55 if valids is not None and value not in valids:
56 raise RuntimeError('Invalid argument "%s"' % name)
57 if invalids is not None and value in invalids:
58 raise RuntimeError('Invalid argument "%s"' % name)
59 if types is not None and not isinstance(value, types):
60 raise RuntimeError('Invalid argument "%s"' % name)
61
62 def _check_path(self, path):
63 if not os.path.exists(path):

Callers 8

do_registerMethod · 0.80
_build_dataMethod · 0.80
_build_targetMethod · 0.80
do_registerMethod · 0.80
do_newMethod · 0.80
do_removeMethod · 0.80
_build_dataMethod · 0.80
_build_targetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected