Commit Graph

58 Commits

Author SHA1 Message Date
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Florian Apolloner 16ee52d21d Fixed #24205 -- Deprecated Signal.disconnect weak parameter. 2015-01-23 14:37:12 -05:00
Tim Graham 851f5bd413 Clarified docstring in dispatch/dispatcher.py 2015-01-23 12:59:59 -05:00
Andriy Sokolovskiy 23f1a8dad2 Added return value to Signal.disconnect(). 2015-01-02 12:00:41 -05:00
Michael Hall 895dc880eb Fixed #23812 -- Changed django.utils.six.moves.xrange imports to range 2014-12-13 12:45:58 -05:00
jerry dumblauskas 5760fe66df Fixed typo in django/dispatch/dispatcher.py docstring. 2014-12-02 07:26:45 -05:00
Unai Zalakain ebb0279f4a Fixed #16245 -- Included traceback in send_robust()'s response
Exceptions from the (receiver, exception) tuples returned by
``send_robust()`` now have always their traceback attached as their
``__traceback__`` argument.
2014-05-16 18:41:40 -04:00
Rodolfo Carvalho 0d91225892 Fixed many typos in comments and docstrings.
Thanks Piotr Kasprzyk for help with the patch.
2014-03-03 07:38:09 -05:00
Florian Apolloner 297c009cf2 Simplified signal code.
Refs #21952
2014-02-05 20:57:40 +01:00
Anssi Kääriäinen c29d6f7676 Fixed #21952 -- signals deadlock due to locking + weakref interaction 2014-02-05 20:57:40 +01:00
Simon Charette c726598c3d Fixed flake8 issues. 2014-01-12 13:40:37 -05:00
Florian Apolloner 7959aff8be Added license info for the weakref backports 2014-01-12 18:35:15 +01:00
Florian Apolloner 52cad43bc3 Fixed removal of signal receivers in Python 3.4
Make use of `weakref.finalize` and `weakref.WeakMethod` on python 3.4.
Simplified the removal of receivers, the old function looked overly
complicated.

Many thanks go to Antoine Pitrou for helping me to debug and explain all
the failures I ran into while writing that patch.
2014-01-09 09:27:54 +01:00
Loic Bistuer 6685713869 Fixed E127 pep8 warnings. 2013-12-14 11:59:15 -05:00
Claude Paroz 42fef29446 Fixed #21486 -- Prevented settings config in signal connection
This was particularly problematic in the chain get_wsgi_application
-> db.connections import -> signal connection -> settings configuration.
Thanks Jon Dufresne for the report.
2013-11-23 18:47:47 +01:00
xuxiang 4cfe6ba6a3 Use `classmethod` as a decorator. 2013-11-19 23:08:21 -05:00
Milton Mazzarri cbc7cbbc5b Fixed flake8 E251 violations 2013-11-03 03:22:11 -06:00
Alex Gaynor 7548aa8ffd More attacking E302 violators 2013-11-02 13:12:09 -07:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Alex Gaynor f2d8027c9a Fixed up some more flake8 violations (this particular violation still has many occurrences in the tests/ dir so it can't be removed from setup.cfg yet) 2013-10-26 10:50:40 -07:00
Alex Gaynor 9bf5610890 Start attacking E231 violations 2013-10-24 10:30:03 -07:00
Tim Graham ae48d77ef8 Fixed E225 pep8 warnings. 2013-10-23 06:09:29 -04:00
Larry O'Neill 83b9bfea44 Fixed #21266 -- Fixed E201,E202 pep8 warnings. 2013-10-14 18:12:00 -04:00
Tim Graham b67ab75e82 Fixed assorted flake8 errors. 2013-10-11 07:25:14 -04:00
Tim Graham 1dae4ac177 Whitespace cleanup.
* Removed trailing whitespace.
* Added newline to EOF if missing.
* Removed blank lines at EOF.
* Removed some stray tabs.
2013-10-10 16:49:20 -04:00
Simon Charette e55ca60903 Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-20 01:53:58 -04:00
Aymeric Augustin e76147a83a Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have
the same hash.

Thanks akaariai for the report and regebro for the patch.
2013-02-25 23:05:20 +01:00
Anssi Kääriäinen 704ee33f50 Fixed #16679 -- Use caching to speed up signal sending 2012-12-16 21:46:02 +02:00
Aymeric Augustin fc10418fba Fixed #18963 -- Used a subclass-friendly pattern
for Python 2 object model compatibility methods.
2012-11-03 22:07:35 +01:00
Anssi Kääriäinen 3fcca0e947 Added a way to check if a signal has listeners 2012-09-28 18:10:52 +03:00
Claude Paroz 60f5e10230 [py3] Fixed dispatch tests 2012-08-15 18:19:21 +02:00
Claude Paroz 576ec12f8e [py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
2012-08-08 15:02:31 +02:00
Aymeric Augustin a84d79f572 [py3] Added Python 3 compatibility for xrange. 2012-07-22 09:29:56 +02:00
Alex Gaynor e0fce8706d Switch to using context managers for acquiring and releasing locks. 2012-06-23 08:11:15 -07:00
Alex Gaynor e1b74d0094 Don't use a list comprehension when we don't need the resulting list. 2012-06-23 07:54:45 -07:00
Dmitry Medvinsky d4da08375b Fixed #18454 -- Added ability to pass a list of signals to `receiver`.
Added ability to use receiver decorator in the following way:

    @receiver([post_save, post_delete], sender=MyModel)
    def signals_receiver(sender, **kwargs):
        ...
2012-06-23 16:31:16 +02:00
Claude Paroz d04f72fb31 Got rid of old __cmp__methods replaced by rich comparison.
The __cmp__ methods are unsupported in Python 3.
_doctest.py has been left untouched because it is likely it will
not be migrated to Python 3.
2012-05-18 14:52:24 +02:00
Claude Paroz bbb12581db Replaced im_func and im_self by __func__ and __self__.
The new names are Python 3 compatible.
2012-05-12 22:35:21 +02:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Honza Král aee9db9b3e Preventing problems possibly introduced by r14662
acquire a lock before entering a try block that ends with the lock's
release. Thanks for the catch Alex.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14668 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 17:34:21 +00:00
Honza Král f27e6f0dd1 Fixed #14533 -- Make django signals more thread-safe. Thanks milosu for the patch!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14662 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 14:54:23 +00:00
Alex Gaynor 352deb0915 Fixed #14559 -- corrected some typos and misleading docstrings. Thanks to Gabriel Hurley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-02 18:30:00 +00:00
Brian Rosner b7f60045fe Fixed #9015 -- added a signal decorator for simplifying signal connections
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 19:58:05 +00:00
Russell Keith-Magee 5211f48ae3 Fixed #12164 -- Removed the Python 2.3 compatibility imports and workarounds. Thanks to timo and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04 14:00:30 +00:00
Jacob Kaplan-Moss c935d7ffe3 Fixed #11134: signals recievers that disconnect during their processing no longer mess things up for other handlers. Thanks, Honza Kral.
While I was at it I also cleaned up the formatting of the docstrings a bit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-20 16:13:55 +00:00
Adrian Holovaty b366bcc962 Fixed #10753 -- Fixed regression in dispatcher after [10398]. Thanks for the patch and tests, minmax
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 18:58:32 +00:00
Jacob Kaplan-Moss 20b598bf3e Fixed #9989: fixed a subtle edge case where removing signals could break. Thanks, ferringb.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10398 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:20:38 +00:00