Skip to content

Commit

Permalink
Namespace bloop's signals #59
Browse files Browse the repository at this point in the history
  • Loading branch information
numberoverzero committed Aug 12, 2016
1 parent 5c39df0 commit dde1592
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 3 additions & 4 deletions bloop/engine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import blinker
import declare

from .client import Client
Expand All @@ -8,7 +7,7 @@
from .index import Index
from .model import ModelMetaclass
from .tracking import clear, is_model_verified, sync, verify_model
from .util import walk_subclasses
from .util import walk_subclasses, signal


__all__ = ["Engine", "before_bind_model", "before_create_table"]
Expand All @@ -21,8 +20,8 @@
}

# Signals!
before_bind_model = blinker.signal("before_bind_model")
before_create_table = blinker.signal("before_create_table")
before_bind_model = signal("before_bind_model")
before_create_table = signal("before_create_table")


def value_of(column):
Expand Down
7 changes: 6 additions & 1 deletion bloop/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import blinker
import weakref

__all__ = ["WeakDefaultDictionary", "ordered", "signal", "walk_subclasses"]

__all__ = ["ordered", "walk_subclasses", "WeakDefaultDictionary"]
# Isolate to avoid collisions with other modules
# Don't expose the namespace.
__signals = blinker.Namespace()
signal = __signals.signal


def ordered(obj):
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
basepython=python35
envlist = unit, docs
envlist = unit, integ, docs

[testenv:unit]
deps = pytest
Expand All @@ -13,7 +13,6 @@ commands =

[testenv:integ]
passenv = AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
ignore_errors = True
deps = pytest
coverage
commands = py.test tests/integ []
Expand Down

0 comments on commit dde1592

Please sign in to comment.