No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. #-*- coding: utf-8 -*-
  2. dyncode = None
  3. ##@page lodel2_start Lodel2 boot mechanism
  4. #
  5. # @par Lodel2 boot sequence
  6. # see @ref install/loader.py
  7. # 1. lodel package is imported
  8. # 2. settings are started
  9. # 3. plugins are pre-loaded from conf to load plugins configuration specs
  10. # 4. settings are loaded from conf and checked
  11. # 3. plugins are loaded (hooks are registered etc)
  12. # 4. "lodel2_bootstraped" hooks are called
  13. # 5. "lodel2_loader_main" hooks are called (if runned from loader.py as main executable)
  14. #
  15. ##@page lodel2_instance_admin Lodel2 instance administration
  16. #
  17. #@section lodel2_instance_adm_tools Tools
  18. #
  19. #@subsection lodel2_instance_makefile Makefile
  20. #
  21. #The Makefile allows to run automated without arguments such as :
  22. #- refresh the dynamic code using conf + EM (target **dyncode**)
  23. #- update databases (target **init_db**)
  24. #- refresh plugins list (target **refresh_plugins**)
  25. #
  26. #@subsection lodel2_instance_adm_scripts lodel_admin.py scripts
  27. #
  28. #In all instances you find a symlink named lodel_admin.py . This script
  29. #contains the code run by @ref lodel2_instance_makefile "Makefile targets"
  30. #and a main function that allows to run it as a CLI script.
  31. #
  32. #@par Script help
  33. #<pre>
  34. #usage: lodel_admin.py [-h] [-L] [ACTION] [OPTIONS [OPTIONS ...]]
  35. #
  36. #Lodel2 script runner
  37. #
  38. #positional arguments:
  39. # ACTION One of the following actions : discover-plugin [...]
  40. # OPTIONS Action options. Use lodel_admin.py ACTION -h to have
  41. # help on a specific action
  42. #
  43. #optional arguments:
  44. # -h, --help show this help message and exit
  45. # -L, --list-actions List available actions
  46. #</pre>
  47. #
  48. #@par Script customization
  49. #
  50. #See @ref lodel2_script_doc "Lodel2 scripting"
  51. #
  52. #
  53. ##@defgroup lodel2_deployment Diffusion and deployment
  54. ##@page lodel2_autotools Lodel2 and autotools integration
  55. #@ingroup lodel2_deployment
  56. #
  57. #Autotools provide a way to distribute a software on Posix platforms.
  58. #
  59. #@section lodel2_autotools_howto Howto use them
  60. #
  61. #Basically you have to run :
  62. #- <code>./bootstrap.sh</code> to generate the configure script( run
  63. #approximatly <code>aclocal; autoconf; automake</code> or
  64. #<code>autoreconf</code> )
  65. #- <code>./configure</code> to generate Makefile s
  66. #- <code>make</code> to build lodel2 (actually to generate lodel/buildconf.py
  67. #from @ref lodel/buildconf.py.in )
  68. #
  69. #Here is a list of most usefull targets provided by lodel2's Makefile :
  70. #- automake targets
  71. # - **all** compile the sources (don't do a lot for a script langage)
  72. # - **clean** delete compiled files (don't do a lot for a script langage)
  73. # - **distclean** enhanced comportment compared to default (delete compiled
  74. #files and generated binary). Here it deletes everything generated by
  75. #<code>./bootstrap.sh && ./configure && make</code>
  76. # - **install** Install lodel2 (for the moment copy the lodel dir in
  77. #the good path (configurable when running ./configure ) )
  78. # - **uninstall** Remove installed files
  79. #- lodel2 specific targets
  80. # - **tests**, **check** and **checks** are aliases for running tests
  81. # - **doc** generate the doxygen documentation
  82. # - **em_test** refresh the example/em_test.pickle file using em_test.py
  83. # - **dyncode** generate a dyncode.py file using lefactory in
  84. #lodel/leapi/dyncode.py
  85. #
  86. #@section lodel2_autotools_why Why using autotools
  87. #
  88. #Python has a lot of packaging and distributing solutions, but none of them
  89. #is as convinent, complete, portable as GNU autotools. For example setup.py
  90. #with distutils has no uninstall target; pip, wheel, easy-install etc brokes
  91. #totally your distribution packaging/upgrade system etc.
  92. #
  93. #Autotools are portable, integrated by debian packaging system ( see
  94. #checkinstall) and can support multi langages.
  95. #
  96. #@section lodel2_autotools_whatfor For doing what
  97. #
  98. #Autotools are here to allow distributing and installing Lodel2 on
  99. #Posix OS.
  100. #
  101. #The distribution mechanisms handles dependencies checking (NO AUTO INSTALL
  102. #WITH BINARY BLOBS !!!), compiling .py files to pyc and pyo, and copy all files
  103. #in the good directories (python libs, doc, scripts etc)
  104. #
  105. #@section lodel2_autotools_how How autotools are integrated
  106. #
  107. #What we call autotools is in fact a lot of software. In our case we use only
  108. #both of them :
  109. #<a href="https://www.gnu.org/software/autoconf/autoconf.html#documentation">
  110. #autoconf</a> and
  111. #<a href="https://www.gnu.org/software/automake/#documentation">automake</a>
  112. #
  113. #A python file is generated ( lodel/buildconf.py from
  114. #@ref lodel/buildconf.py.in) containing various informations gathered during
  115. #the build process (for example the presence of pymongo or the precense of
  116. #the dependency needed by webui etc.)
  117. #
  118. #@subsection lodel2_autoconf Autoconf
  119. #
  120. #Autoconf job is to handle configure.ac file and generated the configure
  121. #script.
  122. #
  123. #@par Configure script
  124. #The configure script job is to check all dependencies fetch all
  125. #path etc. And when runned it generates all Makefile from the Makefile.in files
  126. #(see @ref lodel2_automake "below" )
  127. #
  128. #@par Autoconf macros
  129. #We use both macro family :
  130. #- <a href="https://www.gnu.org/software/automake/manual/html_node/Python.html">
  131. #default autoconf python macro</a>
  132. #- <a href="https://www.gnu.org/software/pyconfigure/manual/">
  133. #pyconfigure autoconf macros</a>
  134. #@see lodel2_autotools_problems
  135. #
  136. #@subsection lodel2_automake Automake
  137. #
  138. #Automake job is to transform the Makefile.am files into Makefile.in files.
  139. #It handles all target creation for build, clean, install, uninstall etc.
  140. #
  141. #@section lodel2_autotools_problems Encontered problems
  142. #
  143. #@ref lodel2_autoconf "Autoconf" use macro "written in m4" (not sure if m4
  144. #is the macro langage). We use two macros sources : automake default python
  145. #support & pyconfigure automake macros.
  146. #
  147. #Those macros are broken with python3 (see
  148. #<a href="https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1408092">
  149. #the python3 sysconfig bug with debian OS</a> ). There is patched version of
  150. #these macro in the m4 directory (and the associated patches :
  151. #@ref m4/python.m4.patch "for automake python macros patch" and
  152. #@ref m4/python_pyconfigure.m4.patch "for pyconfigure python macros patch")
  153. ##@file m4/python.m4.patch
  154. #@ingroup lodel2_deployment
  155. #@brief Patch of automake python macro to solve a bug in pythondir retrieval
  156. #on debian
  157. #@see https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1408092
  158. ##@file m4/python_pyconfigure.m4.patch
  159. #@ingroup lodel2_deployment
  160. #@brief Patch to solve a bug in pyconfigure ac macros in pythondir retrieval
  161. #on debian
  162. #@see https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1408092
  163. ##@file m4/python.m4
  164. #@ingroup lodel2_deployment
  165. #@brief Automake macro for python (patched version)
  166. #@see m4/python.m4.patch
  167. ##@file m4/python_pyconfigure.m4
  168. #@brief Pyconfigure automake macro (patched version)
  169. #@see m4/python_pyconfigure.m4.patch
  170. ##@file configure.ac
  171. #@brief configure script model for autoconf
  172. #@ingroup lodel2_deployment
  173. ##@file Makefile.am
  174. #@brief Makefile model for autotools
  175. #@ingroup lodel2_deployment
  176. ##@file lodel/Makefile.am
  177. #@brief Makefile model for autotools
  178. #@ingroup lodel2_deployment