From db48e94fb6c103a9f1f3c2550cf765f0716602c9 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 9 Feb 2014 21:19:58 +0100 Subject: [PATCH] pass arguments for singleton creation. --- blogtopoid/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blogtopoid/decorators.py b/blogtopoid/decorators.py index 14c2947..867565c 100644 --- a/blogtopoid/decorators.py +++ b/blogtopoid/decorators.py @@ -9,10 +9,10 @@ def singleton(cls): """ instances = {} - def getinstance(): + def getinstance(*args, **kwargs): """ return existing instance of new """ if cls not in instances: - instances[cls] = cls() + instances[cls] = cls(*args, **kwargs) return instances[cls] return getinstance