diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-06 01:14:26 -0500 |
|---|---|---|
| committer | mike bayer <mike_mp@zzzcomputing.com> | 2019-01-06 17:34:50 +0000 |
| commit | 1e1a38e7801f410f244e4bbb44ec795ae152e04e (patch) | |
| tree | 28e725c5c8188bd0cfd133d1e268dbca9b524978 /lib/sqlalchemy/event/api.py | |
| parent | 404e69426b05a82d905cbb3ad33adafccddb00dd (diff) | |
| download | sqlalchemy-1e1a38e7801f410f244e4bbb44ec795ae152e04e.tar.gz | |
Run black -l 79 against all source files
This is a straight reformat run using black as is, with no edits
applied at all.
The black run will format code consistently, however in
some cases that are prevalent in SQLAlchemy code it produces
too-long lines. The too-long lines will be resolved in the
following commit that will resolve all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.
Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
Diffstat (limited to 'lib/sqlalchemy/event/api.py')
| -rw-r--r-- | lib/sqlalchemy/event/api.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py index acfacc233..f9e04503c 100644 --- a/lib/sqlalchemy/event/api.py +++ b/lib/sqlalchemy/event/api.py @@ -14,8 +14,8 @@ from .. import util, exc from .base import _registrars from .registry import _EventKey -CANCEL = util.symbol('CANCEL') -NO_RETVAL = util.symbol('NO_RETVAL') +CANCEL = util.symbol("CANCEL") +NO_RETVAL = util.symbol("NO_RETVAL") def _event_key(target, identifier, fn): @@ -24,8 +24,9 @@ def _event_key(target, identifier, fn): if tgt is not None: return _EventKey(target, identifier, fn, tgt) else: - raise exc.InvalidRequestError("No such event '%s' for target '%s'" % - (identifier, target)) + raise exc.InvalidRequestError( + "No such event '%s' for target '%s'" % (identifier, target) + ) def listen(target, identifier, fn, *args, **kw): @@ -120,9 +121,11 @@ def listens_for(target, identifier, *args, **kw): :func:`.listen` - general description of event listening """ + def decorate(fn): listen(target, identifier, fn, *args, **kw) return fn + return decorate |
