summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-03-02 12:04:32 +0100
committerAaron Bohy <aab@odoo.com>2015-03-02 16:38:34 +0100
commit9ebfa11b8c1130423af2d188d7657c47e599e81b (patch)
treebd8dbbb9d97f3a228c77fddc23414330eb2c70bf
parentfc481c5e3abdbd3a0ea92cf0262afc4e60ab9dc9 (diff)
[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.
-rw-r--r--MANIFEST.in2
-rw-r--r--openerp/cli/scaffold.py8
-rw-r--r--openerp/cli/templates/default/__init__.py.template (renamed from openerp/cli/templates/default/__init__.py)0
-rw-r--r--openerp/cli/templates/default/__openerp__.py.template (renamed from openerp/cli/templates/default/__openerp__.py)0
-rw-r--r--openerp/cli/templates/default/controllers.py.template (renamed from openerp/cli/templates/default/controllers.py)0
-rw-r--r--openerp/cli/templates/default/demo.xml.template (renamed from openerp/cli/templates/default/demo.xml)0
-rw-r--r--openerp/cli/templates/default/models.py.template (renamed from openerp/cli/templates/default/models.py)0
-rw-r--r--openerp/cli/templates/default/security/ir.model.access.csv.template (renamed from openerp/cli/templates/default/security/ir.model.access.csv)0
-rw-r--r--openerp/cli/templates/default/templates.xml.template (renamed from openerp/cli/templates/default/templates.xml)0
-rw-r--r--openerp/cli/templates/theme/__init__.py.template (renamed from openerp/cli/templates/theme/__init__.py)0
-rw-r--r--openerp/cli/templates/theme/__openerp__.py.template (renamed from openerp/cli/templates/theme/__openerp__.py)0
-rw-r--r--openerp/cli/templates/theme/static/style/custom.less.template (renamed from openerp/cli/templates/theme/static/style/custom.less)0
-rw-r--r--openerp/cli/templates/theme/views/options.xml.template (renamed from openerp/cli/templates/theme/views/options.xml)0
-rw-r--r--openerp/cli/templates/theme/views/pages.xml.template (renamed from openerp/cli/templates/theme/views/pages.xml)0
-rw-r--r--openerp/cli/templates/theme/views/snippets.xml.template (renamed from openerp/cli/templates/theme/views/snippets.xml)0
15 files changed, 6 insertions, 4 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 54a5dcd8994..eea6b83adeb 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -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
diff --git a/openerp/cli/scaffold.py b/openerp/cli/scaffold.py
index dc6800d5de8..8b9a4bede14 100644
--- a/openerp/cli/scaffold.py
+++ b/openerp/cli/scaffold.py
@@ -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)\
diff --git a/openerp/cli/templates/default/__init__.py b/openerp/cli/templates/default/__init__.py.template
index 43dbbaa6318..43dbbaa6318 100644
--- a/openerp/cli/templates/default/__init__.py
+++ b/openerp/cli/templates/default/__init__.py.template
diff --git a/openerp/cli/templates/default/__openerp__.py b/openerp/cli/templates/default/__openerp__.py.template
index dab78e6555e..dab78e6555e 100644
--- a/openerp/cli/templates/default/__openerp__.py
+++ b/openerp/cli/templates/default/__openerp__.py.template
diff --git a/openerp/cli/templates/default/controllers.py b/openerp/cli/templates/default/controllers.py.template
index 505208171fc..505208171fc 100644
--- a/openerp/cli/templates/default/controllers.py
+++ b/openerp/cli/templates/default/controllers.py.template
diff --git a/openerp/cli/templates/default/demo.xml b/openerp/cli/templates/default/demo.xml.template
index 6c84d877784..6c84d877784 100644
--- a/openerp/cli/templates/default/demo.xml
+++ b/openerp/cli/templates/default/demo.xml.template
diff --git a/openerp/cli/templates/default/models.py b/openerp/cli/templates/default/models.py.template
index 4d76ef9e2d6..4d76ef9e2d6 100644
--- a/openerp/cli/templates/default/models.py
+++ b/openerp/cli/templates/default/models.py.template
diff --git a/openerp/cli/templates/default/security/ir.model.access.csv b/openerp/cli/templates/default/security/ir.model.access.csv.template
index 71a2352fedc..71a2352fedc 100644
--- a/openerp/cli/templates/default/security/ir.model.access.csv
+++ b/openerp/cli/templates/default/security/ir.model.access.csv.template
diff --git a/openerp/cli/templates/default/templates.xml b/openerp/cli/templates/default/templates.xml.template
index b9166501678..b9166501678 100644
--- a/openerp/cli/templates/default/templates.xml
+++ b/openerp/cli/templates/default/templates.xml.template
diff --git a/openerp/cli/templates/theme/__init__.py b/openerp/cli/templates/theme/__init__.py.template
index 40a96afc6ff..40a96afc6ff 100644
--- a/openerp/cli/templates/theme/__init__.py
+++ b/openerp/cli/templates/theme/__init__.py.template
diff --git a/openerp/cli/templates/theme/__openerp__.py b/openerp/cli/templates/theme/__openerp__.py.template
index 329483fa078..329483fa078 100644
--- a/openerp/cli/templates/theme/__openerp__.py
+++ b/openerp/cli/templates/theme/__openerp__.py.template
diff --git a/openerp/cli/templates/theme/static/style/custom.less b/openerp/cli/templates/theme/static/style/custom.less.template
index e69de29bb2d..e69de29bb2d 100644
--- a/openerp/cli/templates/theme/static/style/custom.less
+++ b/openerp/cli/templates/theme/static/style/custom.less.template
diff --git a/openerp/cli/templates/theme/views/options.xml b/openerp/cli/templates/theme/views/options.xml.template
index e69de29bb2d..e69de29bb2d 100644
--- a/openerp/cli/templates/theme/views/options.xml
+++ b/openerp/cli/templates/theme/views/options.xml.template
diff --git a/openerp/cli/templates/theme/views/pages.xml b/openerp/cli/templates/theme/views/pages.xml.template
index e69de29bb2d..e69de29bb2d 100644
--- a/openerp/cli/templates/theme/views/pages.xml
+++ b/openerp/cli/templates/theme/views/pages.xml.template
diff --git a/openerp/cli/templates/theme/views/snippets.xml b/openerp/cli/templates/theme/views/snippets.xml.template
index e69de29bb2d..e69de29bb2d 100644
--- a/openerp/cli/templates/theme/views/snippets.xml
+++ b/openerp/cli/templates/theme/views/snippets.xml.template