MCPcopy Create free account
hub / github.com/PyTTaMaster/PyTTa / pytta_load

Function pytta_load

pytta/functions.py:731–745  ·  view source on GitHub ↗

Loads .pytta files and parses it's types to the correct objects.

(fileName: str)

Source from the content-addressed store, hash-verified

729
730
731def pytta_load(fileName: str):
732 """
733 Loads .pytta files and parses it's types to the correct objects.
734 """
735 if fileName.split('.')[-1] == 'pytta':
736 with zf.ZipFile(fileName, 'r') as zdir:
737 objects = zdir.namelist()
738 for obj in objects:
739 if obj.split('.')[-1] == 'json':
740 meta = obj
741 zdir.extractall()
742 output = __parse_load(meta)
743 else:
744 raise ValueError("pytta_load function only works with *.pytta files")
745 return output
746
747
748def __parse_load(className):

Callers 2

loadFunction · 0.85
__parse_loadFunction · 0.85

Calls 2

__parse_loadFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected