MCPcopy Create free account
hub / github.com/bugy/script-server / read_short

Function read_short

src/model/script_config.py:366–386  ·  view source on GitHub ↗
(file_path, json_object)

Source from the content-addressed store, hash-verified

364
365
366def read_short(file_path, json_object):
367 name = _read_name(file_path, json_object)
368 allowed_users = json_object.get('allowed_users')
369 admin_users = json_object.get('admin_users')
370 group = read_str_from_config(json_object, 'group', blank_to_none=True)
371
372 hidden = read_bool_from_config('hidden', json_object, default=False)
373 if hidden:
374 return None
375
376 if allowed_users is None:
377 allowed_users = ANY_USER
378 elif (allowed_users == '*') or ('*' in allowed_users):
379 allowed_users = ANY_USER
380
381 if admin_users is None:
382 admin_users = ANY_USER
383 elif (admin_users == '*') or ('*' in admin_users):
384 admin_users = ANY_USER
385
386 return ShortConfig(name=name, group=group, allowed_users=allowed_users, admin_users=admin_users)
387
388
389class ParameterNotFoundException(Exception):

Callers 1

__init__Method · 0.85

Calls 5

read_str_from_configFunction · 0.90
read_bool_from_configFunction · 0.90
_read_nameFunction · 0.85
ShortConfigClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected