Skip to content

Commit

Permalink
Django users can live with another dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ask Solem committed Sep 16, 2010
1 parent 4bdd467 commit 4eb60ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
11 changes: 4 additions & 7 deletions ghettoq/taproot.py
Expand Up @@ -14,12 +14,9 @@




try: try:
from collections import OrderedDict as SortedDict from collections import OrderedDict
except ImportError: except ImportError:
try: from odict import odict as OrderedDict
from django.utils.datastructures import SortedDict
except ImportError:
from odict import odict as SortedDict




class QualityOfService(object): class QualityOfService(object):
Expand All @@ -30,7 +27,7 @@ def __init__(self, backend, resource, prefetch_count=None,
self.resource = resource self.resource = resource
self.prefetch_count = prefetch_count self.prefetch_count = prefetch_count
self.interval = interval self.interval = interval
self._delivered = SortedDict() self._delivered = OrderedDict()
self._restored_once = False self._restored_once = False
atexit.register(self.restore_unacked_once) atexit.register(self.restore_unacked_once)


Expand All @@ -51,7 +48,7 @@ def restore_unacked(self):
message.content_encoding) message.content_encoding)
send["destination"] = queue_name send["destination"] = queue_name
self.resource.put(queue_name, serialize(send)) self.resource.put(queue_name, serialize(send))
self._delivered = SortedDict() self._delivered = OrderedDict()


def requeue(self, delivery_tag): def requeue(self, delivery_tag):
try: try:
Expand Down
10 changes: 3 additions & 7 deletions setup.py
Expand Up @@ -27,14 +27,10 @@
if sys.version_info < (2, 5): if sys.version_info < (2, 5):
install_requires.append("uuid") install_requires.append("uuid")


# We rely on a sorted dictionary implementation and use either python's # We rely on a sorted dictionary implementation and use either Python's
# build-in OrderedDict, Django's SortedDict or odict. # built-in OrderedDict or the odict module.

if sys.version_info < (2, 7): if sys.version_info < (2, 7):
try: install_requires.append("odict")
import django
except ImportError:
install_requires.append("odict")




def osx_install_data(install_data): def osx_install_data(install_data):
Expand Down

0 comments on commit 4eb60ae

Please sign in to comment.