[FIX] Packaging, Scaffolding: template files extension
Add .template as extension of the template files because RPM packaging produces an error when trying to compile the python template files, which contains Jinja instructions. Include *.template files in MANIFEST.in to package them.
This commit is contained in:
parent
fc481c5e3a
commit
9ebfa11b8c
|
@ -17,6 +17,7 @@ recursive-include openerp *.rng
|
|||
recursive-include openerp *.rst
|
||||
recursive-include openerp *.sass
|
||||
recursive-include openerp *.sql
|
||||
recursive-include openerp *.template
|
||||
recursive-include openerp *.txt
|
||||
recursive-include openerp *.ttf
|
||||
recursive-include openerp *.woff
|
||||
|
@ -25,4 +26,3 @@ recursive-include openerp *.xml
|
|||
recursive-include openerp *.yml
|
||||
recursive-exclude * *.py[co]
|
||||
recursive-exclude * *.hg*
|
||||
graft openerp/cli/templates
|
||||
|
|
|
@ -112,16 +112,18 @@ class template(object):
|
|||
"""
|
||||
# overwrite with local
|
||||
for path, content in self.files():
|
||||
_, ext = os.path.splitext(path)
|
||||
|
||||
local = os.path.relpath(path, self.path)
|
||||
# strip .template extension
|
||||
root, ext = os.path.splitext(local)
|
||||
if ext == '.template':
|
||||
local = root
|
||||
dest = os.path.join(directory, modname, local)
|
||||
destdir = os.path.dirname(dest)
|
||||
if not os.path.exists(destdir):
|
||||
os.makedirs(destdir)
|
||||
|
||||
with open(dest, 'wb') as f:
|
||||
if ext not in ('.py', '.xml', '.csv', '.js', '.rst', '.html'):
|
||||
if ext not in ('.py', '.xml', '.csv', '.js', '.rst', '.html', '.template'):
|
||||
f.write(content)
|
||||
else:
|
||||
env.from_string(content)\
|
||||
|
|
Loading…
Reference in New Issue