diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /openerp/cli | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'openerp/cli')
| -rw-r--r-- | openerp/cli/scaffold.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/openerp/cli/scaffold.py b/openerp/cli/scaffold.py index a4b65690382..8194aa6cbba 100644 --- a/openerp/cli/scaffold.py +++ b/openerp/cli/scaffold.py @@ -83,18 +83,21 @@ env.filters['snake'] = snake env.filters['pascal'] = pascal class template(object): def __init__(self, identifier): - # TODO: directories, archives (zipfile, tarfile) + # TODO: archives (zipfile, tarfile) self.id = identifier - if not os.path.isdir(self.path): - die("{} is not a valid module template".format(identifier)) + # is identifier a builtin? + self.path = builtins(identifier) + if os.path.isdir(self.path): + return + # is identifier a directory? + self.path = identifier + if os.path.isdir(self.path): + return + die("{} is not a valid module template".format(identifier)) def __str__(self): return self.id - @property - def path(self): - return builtins(self.id) - def files(self): """ Lists the (local) path and content of all files in the template """ @@ -118,7 +121,7 @@ class template(object): os.makedirs(destdir) with open(dest, 'wb') as f: - if ext not in ('.py', '.xml', '.csv', '.js'): + if ext not in ('.py', '.xml', '.csv', '.js', '.rst', '.html'): f.write(content) else: env.from_string(content)\ |
