diff options
| author | Stéphane Bidoul <stephane.bidoul@acsone.eu> | 2015-01-18 17:43:26 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2015-01-19 10:35:41 +0100 |
| commit | 34fe1d211d36c5b0c6e5fd489aebe45318d6ffd6 (patch) | |
| tree | 5d45707584a030ace2d4874082bf3300caf741bf /openerp/cli | |
| parent | 5c59479577b0ab70c81a3e63deb6039da08b93d2 (diff) | |
[IMP] add support for directory templates in scaffold
closes #4767
Diffstat (limited to 'openerp/cli')
| -rw-r--r-- | openerp/cli/scaffold.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/openerp/cli/scaffold.py b/openerp/cli/scaffold.py index c4f2c44db43..fdbcfb9e4fc 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 """ |
