diff options
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() - |