pass arguments for singleton creation.

This commit is contained in:
chris 2014-02-09 21:19:58 +01:00
parent fe9af95b52
commit db48e94fb6
1 changed files with 2 additions and 2 deletions

View File

@ -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