Permalink
Browse files

improved _exists and 'fixed' pickle.dumps call - thanks Jimmy Yuen Ho…

… Wong
  • Loading branch information...
3kwa committed Sep 28, 2011
1 parent 42c138d commit e55adcd558f5a9f824f9001c382093eb8f3779c4
Showing with 6 additions and 6 deletions.
  1. +4 −4 cherrys.py
  2. +2 −2 setup.py
View
@@ -36,12 +36,12 @@ def setup(cls, **kwargs):
cls.cache = redis.Redis(
host=cls.host,
- port=int(cls.port), # cherrys in charge of converting str to int
+ port=cls.port, # cherrys in charge of converting str to int
db=cls.db,
password=cls.password)
def _exists(self):
- return bool(self.cache.get(self.id))
+ return bool(self.cache.exists(self.id))
def _load(self):
try:
@@ -53,8 +53,8 @@ def _load(self):
def _save(self, expiration_time):
pickled_data = pickle.dumps(
- [self._data, expiration_time,
- pickle.HIGHEST_PROTOCOL])
+ (self._data, expiration_time),
+ pickle.HIGHEST_PROTOCOL)
result = self.cache.setex(self.id, pickled_data, self.timeout * 60)
View
@@ -1,6 +1,6 @@
from setuptools import setup
-version = '0.3'
+version = '0.4'
readme = open('README.rst').read()
setup(
name = 'cherrys',
@@ -15,7 +15,7 @@
test_suite = 'test_cherrys',
install_requires = ['redis >= 2.4.9', 'cherrypy >= 3.2'],
classifiers = [
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: CherryPy',
'Intended Audience :: Developers',

0 comments on commit e55adcd

Please sign in to comment.