Skip to content

Commit

Permalink
make changes mentioned in issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
willforde committed Apr 1, 2018
1 parent ffea630 commit 2dfbab4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions script.module.codequick/lib/codequick/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def flush(self):

def close(self):
"""Close file object."""
self.flush()
if self._stream:
self._stream.close()
self._stream = None
Expand Down Expand Up @@ -125,6 +126,10 @@ class PersistentDict(_PersistentBase, MutableMapping):
``name`` can be a filename, or the full path to a file.
The add-on profile directory will be the default location for files, unless a full path is given.
.. note::
If the 'ttl' parameter is given, any expired data will be removed on initialization.
.. note:: This class is also designed as a context manager.
:Example:
Expand Down Expand Up @@ -193,6 +198,10 @@ class PersistentList(_PersistentBase, MutableSequence):
``name`` can be a filename, or the full path to a file.
The add-on profile directory will be the default location for files, unless a full path is given.
.. note::
If the 'ttl' parameter is given, any expired data will be removed on initialization.
.. note:: This class is also designed as a context manager.
:Example:
Expand Down

0 comments on commit 2dfbab4

Please sign in to comment.