Skip to content

Commit

Permalink
log level and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Feb 5, 2022
1 parent 9284843 commit 026d01f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions json_database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from tempfile import gettempdir

LOG = logging.getLogger("JsonDatabase")
LOG.setLevel("INFO")


class JsonStorage(dict):
Expand All @@ -23,8 +24,6 @@ def __init__(self, path, disable_lock=False):
super().__init__()
lock_path = join(gettempdir(), path.split("/")[-1] + ".lock")
if disable_lock:
LOG.warning("Lock is disabled, database might get corrupted if "
"different processes try to use it at same time!")
self.lock = DummyLock(lock_path)
else:
self.lock = ComboLock(lock_path)
Expand Down Expand Up @@ -301,6 +300,7 @@ def __init__(self, name, xdg_folder=BaseDirectory.xdg_data_home,
path = join(xdg_folder, subfolder, f"{name}.{extension}")
super().__init__(name, path, disable_lock=disable_lock, extension=extension)


class JsonConfigXDG(JsonStorageXDG):
""" xdg respectful config files, using json_storage.JsonStorageXDG """

Expand Down
4 changes: 2 additions & 2 deletions json_database/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def equal(self, key, value, ignore_case=False):
self.result = [a for a in self.result if a[key] == value]
return self

def bellow(self, key, value, ignore_case=False):
def below(self, key, value, ignore_case=False):
self.contains_key(key, ignore_case=ignore_case)
self.result = [a for a in self.result if a[key] < value]
return self
Expand All @@ -145,7 +145,7 @@ def above(self, key, value, ignore_case=False):
self.result = [a for a in self.result if a[key] > value]
return self

def bellow_or_equal(self, key, value, ignore_case=False):
def below_or_equal(self, key, value, ignore_case=False):
self.contains_key(key, ignore_case=ignore_case)
self.result = [a for a in self.result if a[key] <= value]
return self
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='json_database',
version='0.5.6',
version='0.6.0',
packages=['json_database', 'json_database.utils'],
url='https://github.com/HelloChatterbox/json_database',
license='MIT',
Expand Down

0 comments on commit 026d01f

Please sign in to comment.