diff options
author | Ian Bicking <ian@ianbicking.org> | 2005-08-22 23:29:31 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2005-08-22 23:29:31 +0000 |
commit | 82d331036f311709b77a1e3a90a9b191c9e49c61 (patch) | |
tree | 2c91bcd0181be8babe4146c3f448429e4840f29f /paste/webkit/FakeWebware/MiscUtils/ParamFactory.py | |
parent | 36d1c63f5e12f1dfd6d5187359093a96a2fd2de4 (diff) | |
download | paste-git-82d331036f311709b77a1e3a90a9b191c9e49c61.tar.gz |
Moved webkit to separate project
Diffstat (limited to 'paste/webkit/FakeWebware/MiscUtils/ParamFactory.py')
-rw-r--r-- | paste/webkit/FakeWebware/MiscUtils/ParamFactory.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/paste/webkit/FakeWebware/MiscUtils/ParamFactory.py b/paste/webkit/FakeWebware/MiscUtils/ParamFactory.py deleted file mode 100644 index 4b3f2f3..0000000 --- a/paste/webkit/FakeWebware/MiscUtils/ParamFactory.py +++ /dev/null @@ -1,22 +0,0 @@ -from threading import Lock - -class ParamFactory: - def __init__(self, klass, **extraMethods): - self.lock = Lock() - self.cache = {} - self.klass = klass - for name, func in extraMethods.items(): - setattr(self, name, func) - def __call__(self, *args): - self.lock.acquire() - if not self.cache.has_key(args): - value = self.klass(*args) - self.cache[args] = value - self.lock.release() - return value - else: - self.lock.release() - return self.cache[args] - def allInstances(self): - return self.cache.values() - |