diff --git a/README.md b/README.md
index d0200dc..e6b01aa 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ It doesn't do anything crazy. It just takes json serializable data and stores it
You can control when and where to read/write, and that's it.
-No bloat, only 3 public methods.
+No bloat, only 5 public methods.
## Usage
@@ -43,4 +43,4 @@ kv.get('my_key') # returns True.
kv.delete('my_key')
~~~
-***Warning:*** **Be sure to manually flush when destroying the kv instance (such as by exiting your program) to avoid losing data, as flushes only happen when .put has been called.**
\ No newline at end of file
+***Warning:*** **Be sure to keep flush_on_exit set to true or manually flush when destroying the kv instance (such as by exiting your program) to avoid losing data.**
\ No newline at end of file
diff --git a/deadsimplekv/__init__.py b/deadsimplekv/__init__.py
index 36d1584..54a2dd3 100644
--- a/deadsimplekv/__init__.py
+++ b/deadsimplekv/__init__.py
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see
def delete(self, key):
- '''Deletes value. Will automatically flush if auto_flush is True and file_path is not None'''
+ '''
+ Deletes value. Will automatically flush if auto_flush is True and file_path is not None
+ '''
del self._data[key]
self._do_auto_flush()
def flush(self):
- '''Write out then mark time flushed. Can be manually called'''
+ '''
+ Write out then mark time flushed. Can be manually called
+ '''
DeadSimpleKV._write_out(self.file_path, json.dumps(self._data))
self._last_flush = DeadSimpleKV._get_epoch()
Accepts key, which must be json serializable
def get(self, key):
+ '''
+ Accepts key, which must be json serializable
+ '''
self._do_auto_refresh()
try:
return self._data[key]
@@ -342,8 +372,9 @@ Will return value error if either key or value are not JSON serializable
Source code
def put(self, key, value):
- '''Value setter. Will automatically flush if auto_flush is True and file_path is not None
- Will return value error if either key or value are not JSON serializable
+ '''
+ Value setter. Will automatically flush if auto_flush is True and file_path is not None
+ Will return value error if either key or value are not JSON serializable
'''
self._data[key] = value # Set the key
@@ -364,7 +395,9 @@ Will return value error if either key or value are not JSON serializable
Source code
def refresh(self):
- '''Refresh data and then mark time read. Can be manually called'''
+ '''
+ Refresh data and then mark time read. Can be manually called
+ '''
try:
self._data = json.loads(DeadSimpleKV._read_in(self.file_path))
except FileNotFoundError:
@@ -402,7 +435,7 @@ Will return value error if either key or value are not JSON serializable
diff --git a/setup.py b/setup.py
index 969684e..40b5a4f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,10 @@
from distutils.core import setup
-setup(name='deadsimplekv-beardog',
- version='0.0.1',
+setup(name='deadsimplekv',
+ version='0.1.1',
description='Very simple key-value store for Python',
author='Kevin Froman',
- author_email='beardog@firemail.cc',
+ author_email='beardog@mailbox.org',
url='https://github.com/beardog108/deadsimplekv',
packages=['deadsimplekv'],
)
diff --git a/tests/test_basic.py b/tests/test_basic.py
index 624a01c..dd4725a 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -23,6 +23,7 @@ def get_test_id():
return str(uuid.uuid4()) + '.dat'
class TestInit(unittest.TestCase):
+
def test_init(self):
kv = deadsimplekv.DeadSimpleKV(get_test_id())