hpcflow.sdk.core.utils.JSONLikeDirSnapShot#
- class hpcflow.sdk.core.utils.JSONLikeDirSnapShot(root_path=None, data=None, use_strings=False)#
Bases:
DirectorySnapshot
Overridden DirectorySnapshot from watchdog to allow saving and loading from JSON.
- Parameters:
Methods
Returns an id for path.
Returns path for id.
Returns a stat information object for the specified path from the snapshot.
Take the snapshot.
Export to a dict that is JSON-compatible and can be later reloaded.
Attributes
- path(uid)#
Returns path for id. None if id is unknown to this snapshot.
- root_path#
Where to take the snapshot based at.
- stat_info(path)#
Returns a stat information object for the specified path from the snapshot.
Attached information is subject to change. Do not use unless you specify stat in constructor. Use
inode()
,mtime()
,isdir()
instead.
- take(*args, **kwargs)#
Take the snapshot.
- Return type:
None
- to_json_like(use_strings=False)#
Export to a dict that is JSON-compatible and can be later reloaded.
The last two integers in data for each path are the keys in self._inode_to_path.
- walk(root)#
- Parameters:
root (str)
- Return type:
Iterator[tuple[str, os.stat_result]]