Commit e979d4a7 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix some bugs generating the documentation.

parent 41062224
......@@ -46,12 +46,13 @@ import urllib
from os.path import join as opj
from subprocess import call, check_output, CalledProcessError
from tempfile import TemporaryFile
import cmd
# constants
APP = os.path.basename(os.getcwd())
API = 'api'
BUILDDIR = '../plugin_dbui_build'
BUILDDIR = '../plugins'
DOCSRC = 'docs'
LATEX = 'latex'
MSG_RELEASE = 'Enter the new release: '
......@@ -170,8 +171,11 @@ def build():
"""
compile_js()
build_html()
if os.path.exists(DOCS_DIR):
call(["rm", "-rf", DOCS_DIR])
build_html()
for doc in (API, REFERENCE, USER):
build_pdf(doc)
......@@ -229,6 +233,7 @@ def build_pdf(doc):
filenames = [el for el in os.listdir('.') if el.endswith('.tex')]
filename = (filenames[0] if len(filenames) == 1 else None)
fpdf = filename.replace('.tex', '.pdf')
if not filename:
print "\n\tNo latex file !\n"
......@@ -237,19 +242,20 @@ def build_pdf(doc):
try:
check_output(["pdflatex", "-interaction", "nonstopmode", filename])
check_output(["pdflatex", filename])
except CalledProcessError:
print "\n\tFailled to generate PDF file !"
print "\tCheck LaTeX file in", latexdir, "\n"
os.chdir(cwd)
return
check_output(["pdflatex", filename])
if os.path.exists(fpdf):
print "\n\tSome errors in the PDF file."
else:
print "\n\tFailled to generate PDF file !"
print "\tCheck LaTeX file in", latexdir, "\n"
os.chdir(cwd)
return
os.chdir(cwd)
# rename the pdf file as application_doctype.pdf
fpdf = filename.replace('.tex', '.pdf')
fout = "%s_%s.pdf" % (os.path.splitext(filename)[0], doc)
os.rename(opj(latexdir, fpdf), opj(PDFDOC, fout))
......@@ -624,8 +630,12 @@ def jsduck():
return
# clean
print "\n\tRemove old javascript documentation...\n"
call(["rm", "-rf", JSDOC])
if os.path.exists(JSDOC):
print "\n\tRemove old javascript documentation...\n"
call(["rm", "-rf", JSDOC])
if not os.path.exists(DOCS_DIR):
os.mkdir(DOCS_DIR)
# NOTE
# the processing depend on the localisation of jsduck
......@@ -656,7 +666,7 @@ def jsduck():
call(cmd)
cnt = ARGS.docker_container
call(["docker", "exec", cnt, "chown", "-R", get_perm(), JSDOC_CNT])
call(["docker", "exec", cnt, "chown", "-R", get_perm(), DOCS_DIR_CNT])
print "\n\tJavaScript documentation in", JSDOC
......@@ -794,7 +804,7 @@ def sphinx(builder, doc):
if is_behind_cnt:
cnt = ARGS.docker_container
call(["docker", "exec", cnt, "chown", "-R", get_perm(), outdir])
call(["docker", "exec", cnt, "chown", "-R", get_perm(), DOCS_DIR_CNT])
print "\n\t%s documentation in" % builder.upper(), outdir
......
......@@ -370,15 +370,13 @@ class DbSvc(BaseSvc):
Several *create* transactions can be processed at the same time.
Args:
arg (dict): :ref:`input transaction dictionary
<input transaction dictionary>`
arg (dict): input transaction dictionary
Returns:
dict:
:ref:`output transaction dictionary
<output transaction dictionary>`
output transaction dictionary.
The full transaction is aborted when:
* at least one field value is not validated by the
database engine. The keyword ``errors`` contains the
dictionary returns by the validator (the key is the field
......@@ -442,21 +440,20 @@ class DbSvc(BaseSvc):
Args:
arg (dict):
:ref:`input transaction dictionary
<input transaction dictionary>`
input transaction dictionary.
The keyword ``records`` contains the list of ``rec_id``
to be deleted *e.g.* ``[id1, id2, ... ]``.
Returns:
dict:
:ref:`output transaction dictionary
<output transaction dictionary>`
output transaction dictionary.
* The keyword ``records`` is the list of dictionary
containing the ``rec_id`` of the deleted records
*e.g.* ``[{TableId:xx}, ..]``.
containing the ``rec_id`` of the deleted records *e.g.*
``[{TableId:xx}, ..]``.
* The full transaction is aborted when:
- one record does not exist
- the delete operation is rejected by the
......@@ -515,8 +512,8 @@ class DbSvc(BaseSvc):
dictionary *arg*.
Args:
arg (dict): :ref:`input transaction dictionary
<input transaction dictionary>`
arg (dict):
input transaction dictionary:
* The *optional* key ``where`` is a list of string
to build the inner join when handling foreign key::
......@@ -542,8 +539,7 @@ class DbSvc(BaseSvc):
Returns:
dict:
:ref:`output transaction dictionary
<output transaction dictionary>`
output transaction dictionary:
* The keyword ``records`` is a list of dictionary containing
all key value pairs for the record found in the database.
......@@ -627,8 +623,8 @@ class DbSvc(BaseSvc):
Several update transactions can be processed at the same time.
Args:
arg (dict): :ref:`input transaction dictionary
<input transaction dictionary>`.
arg (dict):
input transaction dictionary.
The keyword ``records`` is the list of dictionaries,
one per record to be updated. Each dictionary contains
key, value pairs for fields to be updated as well as
......@@ -636,8 +632,7 @@ class DbSvc(BaseSvc):
Returns:
dict:
:ref:`output transaction dictionary
<output transaction dictionary>`
output transaction dictionary:
* the key ``records`` is a list of dictionary containing
the complete key, value pairs for the ``record`` updated
......
......@@ -214,35 +214,42 @@ class GridModifier(Modifier):
their name.
Keyword Args:
header (str): the header of the ``TemplateColumn``.
header (str):
the header of the ``TemplateColumn``.
tpl (list): the template defining how field values are displayed
tpl (list):
the template defining how field values are displayed
in the ``TemplateColumn``:
* The syntax of the template is is defined in the documentation
of ``Ext.XTemplate`` constructor.
* There is some limitation when defining the template in
python, namely the use of the template member function.
* Database fields are identified using the ``CapWord`` syntax:
``TablenameFieldname``. It works for standard and reference
fields.
* HTML tags are understood.
* Example of a template list::
tpl = [
'<b>{PeopleLast_name}</b><br>',
'{PeopleFirst_name}<br>',
'<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'
]
autohide (bool): hide the columns associated to the fields
* The syntax of the template is is defined in the
documentation of ``Ext.XTemplate`` constructor.
* There is some limitation when defining the template in
python, namely the use of the template member function.
* Database fields are identified using the ``CapWord``
syntax ``TablenameFieldname``. It works for standard
and reference fields.
* HTML tags are understood.
* Example of a template list:
.. code-block:: python
tpl = [
'<b>{PeopleLast_name}</b><br>',
'{PeopleFirst_name}<br>',
'<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'
]
autohide (bool):
hide the columns associated to the fields
consumed in the TemplateColumn when set to ``True``.
position (int): is the number defining where the
position (int):
is the number defining where the
column will be inserted in the grid widget.
The first column is at 0.
extjs (dict): contains the Ext JS configuration options
extjs (dict):
contains the Ext JS configuration options
of the ``Ext.grid.TemplateColumn``.
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment