Skip to content

Commit

Permalink
bumping version to 1.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
BJ Dierkes committed May 3, 2012
1 parent a3e6669 commit 294f3fc
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 29 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -16,7 +16,7 @@ is available online at:

<BR><BR>

1.9.7 - development version (will be released as 1.9.8)
1.9.8 - Thu May 3, 2012
------------------------------------------------------------------------------

Feature Enhancements:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Expand Up @@ -12,7 +12,7 @@
# serve to show the default.

VERSION = '1.9'
RELEASE = '1.9.7'
RELEASE = '1.9.8'

import sys, os
sys.path.insert(0, os.path.abspath('../../src/cement2/'))
Expand Down
3 changes: 2 additions & 1 deletion src/cement2.ext.configobj/requirements.txt
@@ -1 +1,2 @@
ConfigObj
ConfigObj
cement2
2 changes: 1 addition & 1 deletion src/cement2.ext.configobj/setup.py
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement is an advanced CLI Application Framework for Python. This package
Expand Down
3 changes: 2 additions & 1 deletion src/cement2.ext.genshi/requirements.txt
@@ -1 +1,2 @@
genshi
genshi
cement2
2 changes: 1 addition & 1 deletion src/cement2.ext.genshi/setup.py
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement is an advanced CLI Application Framework for Python. This package
Expand Down
3 changes: 2 additions & 1 deletion src/cement2.ext.json/requirements.txt
@@ -1 +1,2 @@
jsonpickle
jsonpickle
cement2
2 changes: 1 addition & 1 deletion src/cement2.ext.json/setup.py
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement is an advanced CLI Application Framework for Python. This package
Expand Down
17 changes: 2 additions & 15 deletions src/cement2.ext.memcached/cement2/ext/ext_memcached.py
Expand Up @@ -5,20 +5,7 @@
"""

from cement2.core import handler, hook
from cement2.core import handler
from cement2.lib.ext_memcached import MemcachedCacheHandler

handler.register(MemcachedCacheHandler)

@hook.register(name='cement_post_setup_hook')
def fix_hosts(app):
# FIX ME: This is a bit of a hack, but works around ConfigParser
# unable to handle lists.
hosts = app.config.get('cache.memcached', 'hosts')
fixed_hosts = []

if type(hosts) == str:
parts = hosts.split(',')
for part in parts:
fixed_hosts.append(part.strip())
app.config.set('cache.memcached', 'hosts', fixed_hosts)
handler.register(MemcachedCacheHandler)
12 changes: 12 additions & 0 deletions src/cement2.ext.memcached/cement2/lib/ext_memcached.py
Expand Up @@ -27,6 +27,18 @@ def __init__(self, *args, **kw):

def _setup(self, *args, **kw):
super(MemcachedCacheHandler, self)._setup(*args, **kw)

# Work around because ConfigParser doesn't support Python types
hosts = self._config('hosts')
fixed_hosts = []

if type(hosts) == str:
parts = hosts.split(',')
for part in parts:
fixed_hosts.append(part.strip())
elif type(hosts) == list:
fixed_hosts = hosts
self.app.config.set(self._meta.config_section, 'hosts', fixed_hosts)
self.mc = pylibmc.Client(self._config('hosts'))

def get(self, key, fallback=None, **kw):
Expand Down
3 changes: 2 additions & 1 deletion src/cement2.ext.memcached/requirements.txt
@@ -1 +1,2 @@
pylibmc
pylibmc
cement2
2 changes: 1 addition & 1 deletion src/cement2.ext.memcached/setup.py
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement is an advanced CLI Application Framework for Python. This package
Expand Down
31 changes: 30 additions & 1 deletion src/cement2.ext.memcached/tests/ext/test_ext_memcached.py
Expand Up @@ -6,7 +6,7 @@
from random import random
from nose.tools import eq_, raises
from nose import SkipTest
from cement2.core import handler
from cement2.core import handler, backend
from cement2 import test_helper as _t

if sys.version_info[0] < 3:
Expand All @@ -24,7 +24,10 @@ def import_memcached():
class MemcachedExtTestCase(unittest.TestCase):
def setUp(self):
self.key = "cement2-tests-random-key-%s" % random()
defaults = backend.defaults('tests', 'cache.memcached')
defaults['cache.memcached']['hosts'] = '127.0.0.1, localhost'
self.app = _t.prep('tests',
config_defaults=defaults,
extensions=['memcached'],
cache_handler='memcached',
)
Expand All @@ -34,6 +37,32 @@ def setUp(self):
def tearDown(self):
self.app.cache.delete(self.key)

def test_memcache_list_type_config(self):
defaults = backend.defaults('tests', 'cache.memcached')
defaults['cache.memcached']['hosts'] = ['127.0.0.1', 'localhost']
self.app = _t.prep('tests',
config_defaults=defaults,
extensions=['memcached'],
cache_handler='memcached',
)
import_memcached()
self.app.setup()
eq_(self.app.config.get('cache.memcached', 'hosts'),
['127.0.0.1', 'localhost'])

def test_memcache_str_type_config(self):
defaults = backend.defaults('tests', 'cache.memcached')
defaults['cache.memcached']['hosts'] = '127.0.0.1, localhost'
self.app = _t.prep('tests',
config_defaults=defaults,
extensions=['memcached'],
cache_handler='memcached',
)
import_memcached()
self.app.setup()
eq_(self.app.config.get('cache.memcached', 'hosts'),
['127.0.0.1', 'localhost'])

def test_memcached_set(self):
self.app.cache.set(self.key, 1001)
eq_(self.app.cache.get(self.key), 1001)
Expand Down
3 changes: 2 additions & 1 deletion src/cement2.ext.yaml/requirements.txt
@@ -1 +1,2 @@
pyYaml
pyYaml
cement2
2 changes: 1 addition & 1 deletion src/cement2.ext.yaml/setup.py
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement is an advanced CLI Application Framework for Python. This package
Expand Down
2 changes: 1 addition & 1 deletion src/cement2/setup.py
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages
import sys, os

VERSION = '1.9.7'
VERSION = '1.9.8'

LONG = """
Cement2 is an advanced CLI Application Framework for Python. This package
Expand Down

0 comments on commit 294f3fc

Please sign in to comment.