|
@@ -21,7 +21,7 @@ __registered_scripts = dict()
|
21
|
21
|
#@ingroup lodel2_script
|
22
|
22
|
#@ingroup lodel2_plugins
|
23
|
23
|
#
|
24
|
|
-#Automatic script registration on child class declaration
|
|
24
|
+#Automatic action registration on child class declaration
|
25
|
25
|
class MetaLodelScript(type):
|
26
|
26
|
|
27
|
27
|
def __init__(self, name, bases, attrs):
|
|
@@ -177,3 +177,44 @@ def main_run():
|
177
|
177
|
ret = script._run()
|
178
|
178
|
ret = 0 if ret is None else ret
|
179
|
179
|
exit(ret)
|
|
180
|
+
|
|
181
|
+##@page lodel2_script_doc Lodel2 scripting
|
|
182
|
+#@ingroup lodel2_script
|
|
183
|
+#
|
|
184
|
+#@section lodel2_script_adm Lodel2 instance administration scripts
|
|
185
|
+#
|
|
186
|
+#Lodel2 provides instance administration operation using Makefiles or
|
|
187
|
+#lodel_admin.py script ( see @ref lodel2_instance_admin ).
|
|
188
|
+#
|
|
189
|
+#The lodel_admin.py script take as first option an action. Each action
|
|
190
|
+#correspond to a sub-script with it's own options etc. To get a list
|
|
191
|
+#of all available action run <code>python3 lodel_admin.py -L</code>.
|
|
192
|
+#
|
|
193
|
+#@section lodel2_script_action lodel_admin.py actions
|
|
194
|
+#
|
|
195
|
+#Action implementation is done by class inheritance. To create a new action
|
|
196
|
+#write a @ref lodel.plugin.scripts.LodelScript "LodelScript" derived class (
|
|
197
|
+#see @ref lodel.plugin.core_scripts "core_scripts.py" file as example )
|
|
198
|
+#
|
|
199
|
+#@subsection lodel2_script_inheritance LodelScript inheritance
|
|
200
|
+#
|
|
201
|
+#In order to implement properly a new action you have to write a new
|
|
202
|
+#@ref lodel.plugin.scripts.LodelScript "LodelScript" derivated class.
|
|
203
|
+#Some methods and attributes are mandatory to write a fully functionnal
|
|
204
|
+#derivated class. Here is a list :
|
|
205
|
+#
|
|
206
|
+#- mandatory methods
|
|
207
|
+# - @ref plugin.scripts.LodelScript.argparser_config() "argparser_config()" :
|
|
208
|
+#(classmethod) initialize argparse.Parser
|
|
209
|
+# - @ref plugin.scripts.LodelScript.run() "run()" : (classmethod) contains the
|
|
210
|
+#code that runs to perform the action
|
|
211
|
+#- mandatory attributes
|
|
212
|
+# - @ref plugin.scripts.LodelScript::_action "_action" : (class attribute)
|
|
213
|
+#stores action name
|
|
214
|
+# - @ref plugin.scripts.LodelScript::_description "_description" : (class
|
|
215
|
+#attribute) sotres a short action description
|
|
216
|
+#
|
|
217
|
+#@note On script's action registration : once child class is written you only
|
|
218
|
+#need to import it to trigger script's action registration (see
|
|
219
|
+#@ref plugin.scripts.MetaLodelScript )
|
|
220
|
+#
|