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 similarity index 100% rename from openerp/cli/templates/default/__init__.py rename to openerp/cli/templates/default/__init__.py.template diff --git a/openerp/cli/templates/default/__openerp__.py b/openerp/cli/templates/default/__openerp__.py.template similarity index 100% rename from openerp/cli/templates/default/__openerp__.py rename to openerp/cli/templates/default/__openerp__.py.template diff --git a/openerp/cli/templates/default/controllers.py b/openerp/cli/templates/default/controllers.py.template similarity index 100% rename from openerp/cli/templates/default/controllers.py rename to openerp/cli/templates/default/controllers.py.template diff --git a/openerp/cli/templates/default/demo.xml b/openerp/cli/templates/default/demo.xml.template similarity index 100% rename from openerp/cli/templates/default/demo.xml rename to openerp/cli/templates/default/demo.xml.template diff --git a/openerp/cli/templates/default/models.py b/openerp/cli/templates/default/models.py.template similarity index 100% rename from openerp/cli/templates/default/models.py rename to 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 similarity index 100% rename from openerp/cli/templates/default/security/ir.model.access.csv rename to 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 similarity index 100% rename from openerp/cli/templates/default/templates.xml rename to openerp/cli/templates/default/templates.xml.template diff --git a/openerp/cli/templates/theme/__init__.py b/openerp/cli/templates/theme/__init__.py.template similarity index 100% rename from openerp/cli/templates/theme/__init__.py rename to openerp/cli/templates/theme/__init__.py.template diff --git a/openerp/cli/templates/theme/__openerp__.py b/openerp/cli/templates/theme/__openerp__.py.template similarity index 100% rename from openerp/cli/templates/theme/__openerp__.py rename to 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 similarity index 100% rename from openerp/cli/templates/theme/static/style/custom.less rename to 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 similarity index 100% rename from openerp/cli/templates/theme/views/options.xml rename to 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 similarity index 100% rename from openerp/cli/templates/theme/views/pages.xml rename to 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 similarity index 100% rename from openerp/cli/templates/theme/views/snippets.xml rename to openerp/cli/templates/theme/views/snippets.xml.template