Fixes #18, fixes #19 -- Use six forPython 3 compatibility.

This commit is contained in:
Tyson Clugg 2015-10-29 10:02:31 +11:00
parent a3c9f9c802
commit 9c865dd978
4 changed files with 6 additions and 11 deletions

View file

@ -6,6 +6,8 @@ NEW="$( git rev-parse --abbrev-ref HEAD | cut -d / -f 2 )"
echo "Bumping version ${OLD} -> ${NEW}...\n"
sed -e "s/^ version='${OLD}'/ version='${NEW}'/" setup.py > .setup.py
mv .setup.py setup.py
sed -e "s/^__version__ = '${OLD}'$/__version__ = '${NEW}'/" dddp/__init__.py > .__init__.py
mv .__init__.py dddp/__init__.py
sed -e "s/^version = '${OLD%.*}'/version = '${NEW%.*}'/" -e "s/^release = '${OLD}'/release = '${NEW}'/" docs/conf.py > docs/.conf.py
mv docs/.conf.py docs/conf.py
git diff setup.py docs/conf.py

View file

@ -2,19 +2,10 @@
from __future__ import unicode_literals
import os.path
import sys
from pkg_resources import get_distribution, DistributionNotFound
from gevent.local import local
from dddp import alea
try:
_dist = get_distribution('django-ddp')
if not __file__.startswith(os.path.join(_dist.location, 'django-ddp', '')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
__version__ = 'development'
else:
__version__ = _dist.version
__version__ = '0.17.1'
default_app_config = 'dddp.apps.DjangoDDPConfig'
@ -80,7 +71,7 @@ class ThreadLocal(local):
def get(self, name, factory, *factory_args, **factory_kwargs):
"""Get attribute, creating if required using specified factory."""
update_thread_local = getattr(factory, 'update_thread_local', True)
if (not update_thread_local) or (not hasattr(self, name)):
if (not update_thread_local) or (name not in self.__dict__):
obj = factory(*factory_args, **factory_kwargs)
if update_thread_local:
setattr(self, name, obj)

View file

@ -2,3 +2,4 @@ Django==1.8.5
gevent==1.0.2
gevent-websocket==0.9.5
psycopg2==2.6.1
six==1.10.0

View file

@ -62,6 +62,7 @@ setup(
'psycogreen>=1.0',
'django-dbarray>=0.2',
'pybars3>=0.9.1',
'six>=1.10.0',
],
entry_points={
'console_scripts': [