Skip to content

Commit

Permalink
0.0.3 [release]
Browse files Browse the repository at this point in the history
  • Loading branch information
bboonstra committed Oct 19, 2024
1 parent 41284cb commit f75626d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"MD026": false
}
}
12 changes: 3 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p",
"test_*.py"
],
"python.testing.unittestArgs": ["-v", "-s", ".", "-p", "test_*.py"],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
}
"python.testing.unittestEnabled": true
}
8 changes: 5 additions & 3 deletions effortless/effortless.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
import json
import os

_STORAGE_FILE = 'db.effortless'
_STORAGE_FILE = "db.effortless"


def set(obj):
"""Store an object in a persistent file-based storage."""
with open(_STORAGE_FILE, 'w') as f:
with open(_STORAGE_FILE, "w") as f:
json.dump(obj, f)


def get():
"""Retrieve the stored object from file-based storage."""
if not os.path.exists(_STORAGE_FILE):
return None
with open(_STORAGE_FILE, 'r') as f:
with open(_STORAGE_FILE, "r") as f:
return json.load(f)

0 comments on commit f75626d

Please sign in to comment.