This page describes all the parameters you can use in the description file. There are two categories of parameters: the global parameters, traditionally at the beginning of the description file, and the entry parameters, for each entry.
String values must be enclosed within quotes or double
quotes. List values are separated by commas and enclosed between
square brackets. Tuple values are separated by commas and
enclosed within 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 = 'shell' |
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, which is almost identical
to the perl format. 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 omitted if you don't
use the presence entry
parameter. |
|
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)=
|
new_entry |
||
presence: | mandatory if config_file_type is custom and you want LUCI to add new entries to 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 replaced by the comment (if the entry is optional), the name
and the value of a new entry.
<comment> should be omitted if you don't use the presence
entry parameter.
If all the parameters are already in the configuration file, then you should omit this parameter. |
|
example: | the new_entry corresponding to the shell_env
type
should be defined as follows:
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 optional inactive entry in the configuration file.
If all the parameters are already in the configuration file, then you should omit this parameter. |
|
example: | 'description' : 'description of the entry' |
Entry Parameters |
Example of an entry definition:
entry1={
'entry_parametrer_1' : 'string_value1', 'entry_parametrer_2' : 'string_value2', 'entry_parametrer_3' : 10 } |
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 within 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: | pair of integers | |
description: | Lower and upper bounds for the value for an integer. | |
example: | 'integer_limits' : (0, 1000) |
list_values |
||
presence: | mandatory if value_type=list, useless otherwise | |
type: | list of strings OR list of pairs of strings | |
description: | Specify the acceptable values for the entry. You can display alternative strings corresponding to the values by using a list of pairs, 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')] |