templates: de-hardcode le path des templates
This commit is contained in:
parent
f22c465070
commit
8698895a87
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
from gestion.affichage import style, tableau
|
from gestion.affichage import style, tableau
|
||||||
import importlib
|
import importlib
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
import ldap
|
import ldap
|
||||||
import sys
|
import sys
|
||||||
|
@ -161,7 +162,8 @@ def template(dialog=False):
|
||||||
tableau = newTableau
|
tableau = newTableau
|
||||||
newStyle = lambda *args,**kwargs:oldstyle(*args,dialog=dialog,**kwargs)
|
newStyle = lambda *args,**kwargs:oldstyle(*args,dialog=dialog,**kwargs)
|
||||||
style = newStyle
|
style = newStyle
|
||||||
template_path = '/usr/scripts/lc_ldap/printing/templates/'
|
#template_path = '/usr/scripts/lc_ldap/printing/templates/'
|
||||||
|
template_path = os.path.dirname(os.path.abspath(__file__)) + '/'
|
||||||
templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
|
templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
|
||||||
templateEnv = jinja2.Environment( loader=templateLoader, trim_blocks=True )
|
templateEnv = jinja2.Environment( loader=templateLoader, trim_blocks=True )
|
||||||
templateEnv.add_extension('jinja2.ext.do')
|
templateEnv.add_extension('jinja2.ext.do')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue