Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpgritti@gmail.com>2008-10-04 01:50:00 (GMT)
committer Marco Pesenti Gritti <mpgritti@gmail.com>2008-10-04 01:50:00 (GMT)
commit405dc0bf339939bb2468c63910c16dad35f95710 (patch)
tree8f2e84bac28907803a1be51bb37f015cf15932cc
parente5355ce1b72006093ebee4da4aa400db980c0d23 (diff)
Add django license. Fix django imports.
-rw-r--r--src/sugar/dispatch/__init__.py2
-rw-r--r--src/sugar/dispatch/dispatcher.py27
-rw-r--r--src/sugar/dispatch/license.txt30
3 files changed, 33 insertions, 26 deletions
diff --git a/src/sugar/dispatch/__init__.py b/src/sugar/dispatch/__init__.py
index 0798acc..776b1bc 100644
--- a/src/sugar/dispatch/__init__.py
+++ b/src/sugar/dispatch/__init__.py
@@ -6,4 +6,4 @@ See license.txt for original license.
Heavily modified for Django's purposes.
"""
-from django.dispatch.dispatcher import Signal \ No newline at end of file
+from sugar.dispatch.dispatcher import Signal
diff --git a/src/sugar/dispatch/dispatcher.py b/src/sugar/dispatch/dispatcher.py
index 74fdd20..6855a5b 100644
--- a/src/sugar/dispatch/dispatcher.py
+++ b/src/sugar/dispatch/dispatcher.py
@@ -4,7 +4,7 @@ try:
except NameError:
from sets import Set as set # Python 2.3 fallback
-from django.dispatch import saferef
+from sugar.dispatch import saferef
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
@@ -60,30 +60,7 @@ class Signal(object):
may be anything hashable.
returns None
- """
- from django.conf import settings
-
- # If DEBUG is on, check that we got a good receiver
- if settings.DEBUG:
- import inspect
- assert callable(receiver), "Signal receivers must be callable."
-
- # Check for **kwargs
- # Not all callables are inspectable with getargspec, so we'll
- # try a couple different ways but in the end fall back on assuming
- # it is -- we don't want to prevent registration of valid but weird
- # callables.
- try:
- argspec = inspect.getargspec(receiver)
- except TypeError:
- try:
- argspec = inspect.getargspec(receiver.__call__)
- except (TypeError, AttributeError):
- argspec = None
- if argspec:
- assert argspec[2] is not None, \
- "Signal receivers must accept keyword arguments (**kwargs)."
-
+ """
if dispatch_uid:
lookup_key = (dispatch_uid, _make_id(sender))
else:
diff --git a/src/sugar/dispatch/license.txt b/src/sugar/dispatch/license.txt
index 505090d..0272c28 100644
--- a/src/sugar/dispatch/license.txt
+++ b/src/sugar/dispatch/license.txt
@@ -1,3 +1,33 @@
+sugar.dispatch was originally forked from django.dispatch
+
+Copyright (c) Django Software Foundation and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of Django nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
django.dispatch was originally forked from PyDispatcher.
PyDispatcher License: