mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 18:06:46 +00:00
add docstrings
This commit is contained in:
parent
b0309331a5
commit
5855a30e34
@ -146,10 +146,17 @@ class _LeaseStateSerializer(object):
|
||||
)
|
||||
|
||||
def load(self):
|
||||
"""
|
||||
:returns: deserialized JSON state
|
||||
"""
|
||||
with self._path.open("rb") as f:
|
||||
return json.load(f)
|
||||
|
||||
def save(self, data):
|
||||
"""
|
||||
Serialize the given data as JSON into the state-path
|
||||
:returns: None
|
||||
"""
|
||||
tmpfile = self._path.siblingExtension(".tmp")
|
||||
with tmpfile.open("wb") as f:
|
||||
json.dump(data, f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user