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