Add some utility functions
This commit is contained in:
parent
f9d023f10b
commit
39cc4cfabe
|
@ -0,0 +1,17 @@
|
|||
from zope import component
|
||||
from plone.registry.interfaces import IRegistry
|
||||
from interfaces import ITabellioSettings
|
||||
|
||||
|
||||
def get_dossiers_path():
|
||||
return component.getUtility(IRegistry).forInterface(ITabellioSettings, False).dossiersPath
|
||||
|
||||
def get_documents_path():
|
||||
return component.getUtility(IRegistry).forInterface(ITabellioSettings, False).documentsPath
|
||||
|
||||
|
||||
def get_sessions():
|
||||
settings = component.getUtility(IRegistry).forInterface(ITabellioSettings, False)
|
||||
sessions = settings.sessions
|
||||
terms = [x.split(':')[1].strip() for x in sessions.splitlines() if x]
|
||||
return terms
|
Reference in New Issue