Ingen beskrivning
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 7.7KB

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