source: products/qtheme.template/trunk/qthemetemplate/qplone3_theme.py @ 2864

Last change on this file since 2864 was 2864, checked in by mylan, 9 years ago

Fixed NotImplementedError? for namespace_package2 var

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1import os
2import copy
3import datetime
4
5from zopeskel.plone3_theme import Plone3Theme
6from zopeskel.base import get_var
7
8try:
9    from zopeskel.vars import StringVar as str_var
10except ImportError:
11    from zopeskel.vars import var as str_var
12
13class qPlone3Theme(Plone3Theme):
14    _template_dir = 'templates/qplone3_theme'
15    summary = "A Quinta Group Theme for Plone 3.0 with nested namespace"
16    required_templates = ['plone_app']
17    use_cheetah = True
18    use_local_commands = True
19
20    vars = copy.deepcopy(Plone3Theme.vars)
21    get_var(vars, 'namespace_package').default = 'quintagroup'
22    get_var(vars, 'namespace_package').description = 'Namespace package (like quintagroup)'
23    get_var(vars, 'author').default = 'Quintagroup'
24    get_var(vars, 'author_email').default = 'skins.develop.group@quintagroup.com'
25    get_var(vars, 'keywords').default = get_var(vars, 'keywords').default + ' quintagroup'
26    get_var(vars, 'url').default = 'http://svn.quintagroup.com/skins'
27    get_var(vars, 'package').default = 'example'
28    get_var(vars, 'description').default = 'An installable Quintagroup theme for Plone 3'
29    get_var(vars, 'version').default = '0.1'
30    vars.insert(1, str_var('namespace_package2',
31                        'Nested namespace package (like theme)',
32                        default='theme'))
33
34    def pre(self, command, output_dir, vars):
35        vars['timestamp'] = datetime.date.today().strftime("%Y%m%d")
36        super(qPlone3Theme, self).pre(command, output_dir, vars)
37
38    def post(self, command, output_dir, vars):
39        np2, np = vars['namespace_package2'], vars['namespace_package']
40        p = vars['package']
41        sdir = os.path.join(output_dir, np, np2, p, 'skins')
42
43        # Prevent overriding passed config file
44        # Result config will be written to same
45        # name file with '.result' postfix
46        if command.options.config:
47            command.options.config += '.result'
Note: See TracBrowser for help on using the repository browser.