Salome HOME
add the template command
[tools/sat.git] / data / templates / PythonComponent / template.info
1 #!/usr/bin/env python
2 #-*- coding:utf-8 -*-
3
4 # description of the template to be displayed with option --info
5 info = """
6 Author: CEA
7 Version: 1.0
8 Date: 01/03/2012
9 Description: This template can be used to create a python module for SALOME.
10 """
11
12 # code to substitute with component name
13 file_subst = "PYCMP"
14
15 # delimiter used in the template (default is ':sat:')
16 #delimiter = ":sat:"
17
18 # filter of files to ignore for substitution
19 # if not defined all files will be parsed
20 ignore_filters = '*.png'
21
22 # list of parameters
23 # a string = parameter name
24 # a tuple = (parameter name, default value, prompt, validation method)
25
26 #there is a problem for loading modules if user choose something else than standard "resources directory (lowercase)"
27 #so we need force standard choice...
28 #    ('PYCMP_minus', "%(name)s", "resources directory (lowercase)", lambda l: l.islower() and l.replace("_","").isalnum()),
29
30 parameters = [
31     (file_subst, "%(NAME)s"),
32     ('PYCMPCompoName', "%(Name)s", "Name of the module (hit return!)"),
33     ('PYCMP_minus', "%(name)s", "resources directory (lowercase) (hit return!)", lambda l: l.islower() and l.replace("_","").isalnum()),
34     ("get_method", "archive", "get method for prepare", lambda l: l in ['cvs', 'git', 'archive'])
35     ]
36
37 # configuration to use this component with sat
38 pyconf = """
39 TOOLS : { common : { module_info : {
40     '%(NAME)s':
41     {
42         name : "%(NAME)s"
43         has_gui : "yes"
44         get_sources : '%(get_method)s'
45         build_sources : 'autotools'
46         git_info:
47         {
48             repo : 'to be filled'
49             tag : 'to be filled'
50         }
51         archive_info:
52         {
53             archive_name : '%(target)s.tar.gz'
54         }
55         nb_proc : 1
56         source_dir : $TOOLS.common.source_root + '/' + $name
57         build_dir : $TOOLS.common.build_root + '/' + $name
58         depend : [ 'Python', 'KERNEL', 'GUI' ]
59         opt_depend : []
60     }
61 }}}
62 """