forked from github/pelican
refactored code and introduced a new signal in ArticlesGenerator __init__
This commit is contained in:
parent
575905ac53
commit
48d7df72f1
4 changed files with 18 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue