Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions csp/impl/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,12 @@ def collectts(cls, **kwargs):

return csp.struct_collectts(cls, kwargs)

@classmethod
def _postprocess_dict_to_python(cls, d):
return d

@classmethod
def _obj_to_python(cls, obj):
if isinstance(obj, Struct):
return obj._postprocess_dict_to_python(
{k: cls._obj_to_python(getattr(obj, k)) for k in obj.__full_metadata_typed__ if hasattr(obj, k)}
)
return {k: cls._obj_to_python(getattr(obj, k)) for k in obj.__full_metadata_typed__ if hasattr(obj, k)}
elif isinstance(obj, dict):
return {k: cls._obj_to_python(v) for k, v in obj.items()}
return type(obj)({k: cls._obj_to_python(v) for k, v in obj.items()}) # type() for derived dict types
elif (
isinstance(obj, (list, tuple, set)) or type(obj).__name__ == "FastList"
): # hack for FastList that is not a list
Expand All @@ -126,10 +120,6 @@ def _obj_to_python(cls, obj):
else:
return obj

@classmethod
def _preprocess_dict_from_python(cls, d):
return d

@classmethod
def _obj_from_python(cls, json, obj_type):
obj_type = ContainerTypeNormalizer.normalize_type(obj_type)
Expand All @@ -154,7 +144,6 @@ def _obj_from_python(cls, json, obj_type):
elif issubclass(obj_type, Struct):
if not isinstance(json, dict):
raise TypeError("Representation of struct as json is expected to be of dict type")
json = obj_type._preprocess_dict_from_python(json)
res = obj_type()
for k, v in json.items():
expected_type = obj_type.__full_metadata_typed__.get(k, None)
Expand Down
Empty file removed csp/tests/impl/utils/__init__.py
Empty file.
138 changes: 0 additions & 138 deletions csp/tests/impl/utils/test_lock_file.py

This file was deleted.

134 changes: 0 additions & 134 deletions csp/utils/file_permissions.py

This file was deleted.

Loading