MCPcopy Create free account
hub / github.com/charleshsc/QT / default

Method default

logger.py:233–244  ·  view source on GitHub ↗
(self, o)

Source from the content-addressed store, hash-verified

231
232class MyEncoder(json.JSONEncoder):
233 def default(self, o):
234 if isinstance(o, type):
235 return {'$class': o.__module__ + "." + o.__name__}
236 elif isinstance(o, Enum):
237 return {
238 '$enum': o.__module__ + "." + o.__class__.__name__ + '.' + o.name
239 }
240 elif callable(o):
241 return {
242 '$function': o.__module__ + "." + o.__name__
243 }
244 return json.JSONEncoder.default(self, o)
245
246
247def mkdir_p(path):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected