diff options
author | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-05-13 15:04:02 +0200 |
---|---|---|
committer | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-05-13 15:04:02 +0200 |
commit | ef0a432b0dab5b72405637c8790f107ad1b36423 (patch) | |
tree | ca08a00e2adbbb79d426d01146bd7b5cb5626a19 | |
parent | be487c0d9ae34516eb452e7c8274e7642b1b57a7 (diff) | |
download | logilab-common-ef0a432b0dab5b72405637c8790f107ad1b36423.tar.gz |
delete-trailing-spaces
-rw-r--r-- | decorators.py | 10 | ||||
-rw-r--r-- | interface.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/decorators.py b/decorators.py index 001563e..1eafb47 100644 --- a/decorators.py +++ b/decorators.py @@ -16,7 +16,7 @@ def cached(callableobj, keyarg=None): """Simple decorator to cache result of method call.""" #print callableobj, keyarg, callableobj.func_code.co_argcount if callableobj.func_code.co_argcount == 1 or keyarg == 0: - + def cache_wrapper1(self, *args): cache = '_%s_cache_' % callableobj.__name__ #print 'cache1?', cache @@ -28,9 +28,9 @@ def cached(callableobj, keyarg=None): setattr(self, cache, value) return value return cache_wrapper1 - + elif keyarg: - + def cache_wrapper2(self, *args, **kwargs): cache = '_%s_cache_' % callableobj.__name__ key = args[keyarg-1] @@ -89,10 +89,10 @@ class wproperty(object): def __init__(self, setfunc): self.setfunc = setfunc self.attrname = '_%s' % setfunc.__name__ - + def __set__(self, obj, value): self.setfunc(obj, value) - + def __get__(self, obj, cls): assert obj is not None return getattr(obj, self.attrname) diff --git a/interface.py b/interface.py index 6bef82f..c864a8c 100644 --- a/interface.py +++ b/interface.py @@ -21,7 +21,7 @@ class Interface(object): return implements(instance, cls) is_implemented_by = classmethod(is_implemented_by) - + def implements(obj, interface): """Return true if the give object (maybe an instance or class) implements the interface. @@ -39,7 +39,7 @@ def extend(klass, interface, _recurs=False): """Add interface to klass'__implements__ if not already implemented in. If klass is subclassed, ensure subclasses __implements__ it as well. - + NOTE: klass should be e new class. """ if not implements(klass, interface): |