This page describes all the parameters you can use in the description
file. There is two catagories of parameters: the global
parameters, traditionnally at the beginning of the description file,
and the entry parameters, for each entry.
String values must be enclosed between quotes ou double quotes. List
values are separated by commas and enclosed between square brackets. Tuple
values are separated by commas and enclosed between parenthesis.
Global Parameters |
config_file_name |
||
presence: | mandatory | |
type: | string | |
description: | Name of the configuration file to edit. | |
example: | config_file_name = '/etc/config.file' |
config_file_type |
|||||||||
presence: | mandatory | ||||||||
type: | string | ||||||||
description: | Type of the configuration file to edit.
Type can be one of the following:
|
||||||||
example: | config_file_type = '/etc/config.file' |
pattern |
||
presence: | mandatory if config_file_type is custom | |
type: | string | |
description: | Specify a regular expression describing an
entry line in the configuration file. This regular expression uses the
format of the re Python module, wich is almost identical to the perl one.
Read the excellent Python
Regular Expression HOWTO by A.M. Kuchling if you want to learn more
about how to write your own.
This regular expression must contains 3 named groups: <comment>, <variable> and <value>. <comment> should match the comment in an entry, <variable> the name of the entry and <value> its value. <comment> should be ommited if you don't use the presence entry parameter. Note: you can place a r before the string, so the special meaning of the backslashs are ignored. |
|
example: | the pattern corresponding to the shell_env
type should be defined as follow (on one line):
pattern=r'\s*(?P<comment>#?)\s*export\s+(?P<variable>\b\w+\b)= (?P<value>\S*(?:\s*[^\s#]+)*)(?:\s*)|(?:\s+#.*)$' |
new_entry |
||
presence: | mandatory if config_file_type is custom and you want LUCI to add new entries in the configuration file. | |
type: | string | |
description: | Specify how to write a new entry in the configuration
file. It must contains the strings <comment>, <name>
and <value>. They will be remplaced by the comment (if
the entry is optional), the name and the value of a new entry.
<comment> should be ommited if you don't use the presence entry parameter. The string should end with a newline (\n). If all the parameters are already in the configuration file, then you should ommit this parameter. |
|
example: | the new_entry corresponding to the shell_env
type should be defined as follow:
new_entry='<comment>export <name>=<value>\n' |
comment |
||
presence: | mandatory if config_file_type is custom and you want LUCI to add entries with the presence entry parameter | |
type: | string | |
description: | Specify what string to use as a comment when
LUCI add a optionnal inactive entry in the configuration file.
If all the parameters are already in the configuration file, then you should ommit this parameter. |
|
example: | the new_entry corresponding to the shell_env
type should be defined as follow:
new_entry='<comment>export <name>=<value>\n' |
Entry Parameters |
entry1={
'entry_parametrer_1' : 'value1', 'entry_parametrer_2' : 'value2', 'entry_parametrer_3' : 'value3' } |
name |
||
presence: | mandatory | |
type: | string | |
description: | Name of the entry as it appears in the window. | |
example: | 'name' : 'an entry' |
config_name |
||
presence: | mandatory | |
type: | string | |
description: | Name of the entry in the configuration file. | |
example: | 'config_name' : 'ENTRY' |
value_type |
|||||||||
presence: | optional (type string by default) | ||||||||
type: | string | ||||||||
description: | Type of the entry. The types are:
|
||||||||
example: | 'value_type' : 'filename' |
max_length |
||
presence: | optional | |
type: | integer | |
description: | Maximum length of the value in this entry (in characters) | |
example: | 'max_length' : 20 |
size |
||
presence: | optional | |
type: | integer | |
description: | Length (in pixels) of the entry in the window. | |
example: | 'size' : 110 |
integer_limits |
||
presence: | mandatory if value_type=integer, useless otherwise | |
type: | couple of integer | |
description: | Boundaries of the value for the integer. | |
example: | 'integer_limits' : (0, 1000) |
list_values |
||
presence: | mandatory if value_type=list, useless otherwise | |
type: | list of strings OR list of couples of strings | |
description: | Specifie the accetable values for the entry. You can display alternative strings corresponding to the values by using a list of couples, where the first string will be displayed in the window, and the second string will be written in the configuration file (see the second example below). | |
examples: | 'list_values' : ['item1',
'item2', 'item3']
'list_values' : [('Yes', '1'), ('No', '0')] |