1
0
Fork 0
forked from github/pelican

refactored code and introduced a new signal in ArticlesGenerator __init__

This commit is contained in:
Marco Milanesi 2011-09-07 17:08:28 +02:00
commit 48d7df72f1
4 changed files with 18 additions and 22 deletions

View file

@ -222,15 +222,3 @@ def files_changed(path, extensions):
LAST_MTIME = mtime
return True
return False
def singleton(cls):
"""
Singleton decorator for multiple calls inside plugins
for an example see pelican/plugins/github_activity.py
"""
instances = {}
def getinstance(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
return instances[cls]
return getinstance