From 47e03322c35c394057cd76e241725ee56946388d Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 7 Oct 2014 22:32:14 -0700 Subject: [PATCH] Added shortcuts to AttributeStorage/Lite --- pyircbot/modules/AttributeStorage.py | 6 ++++++ pyircbot/modules/AttributeStorageLite.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/pyircbot/modules/AttributeStorage.py b/pyircbot/modules/AttributeStorage.py index 263c448..ea3861c 100644 --- a/pyircbot/modules/AttributeStorage.py +++ b/pyircbot/modules/AttributeStorage.py @@ -91,6 +91,9 @@ class AttributeStorage(ModuleBase): return {} return item + def get(self, item, key): + return self.getKey(item, key) + def getKey(self, item, key): """Get the value of an key on an item @@ -123,6 +126,9 @@ class AttributeStorage(ModuleBase): return None return row["value"] + def set(self, item, key, value): + return self.setKey(item, key, value) + def setKey(self, item, key, value): """Set the key on an item diff --git a/pyircbot/modules/AttributeStorageLite.py b/pyircbot/modules/AttributeStorageLite.py index 4ef3275..f6f3bb4 100644 --- a/pyircbot/modules/AttributeStorageLite.py +++ b/pyircbot/modules/AttributeStorageLite.py @@ -86,6 +86,8 @@ class AttributeStorageLite(ModuleBase): return {} return item + def get(self, item, key): + return self.getKey(item, key) def getKey(self, item, key): """Get the value of an key on an item @@ -119,6 +121,8 @@ class AttributeStorageLite(ModuleBase): return None return row["value"] + def set(self, item, key, value): + return self.setKey(item, key, value) def setKey(self, item, key, value): """Set the key on an item