Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

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

Remove trailing spaces.

parent 4912cbca
......@@ -13,7 +13,7 @@ def index():
url = URL('plugin_dbui', 'debug', args=request.args, vars=request.vars)
else:
url = URL('plugin_dbui', 'index', args=request.args, vars=request.vars)
return redirect(url)
......@@ -22,7 +22,7 @@ def pack_plugin():
Used by the script buildVersion when building a new release.
Light version of the appadmin/default/pack_plugin controller.
"""
pname = 'dbui'
fname = 'web2py.plugin.%s.w2p' % pname
......@@ -32,7 +32,7 @@ def pack_plugin():
response.headers['Content-Type'] = 'application/w2p'
disposition = 'attachment; filename=%s' % fname
response.headers['Content-Disposition'] = disposition
fi = open(filename, 'rb')
try:
return fi.read()
......
""" Collection of controllers to build reports
""" Collection of controllers to build reports
"""
from plugin_dbui import Selector
......@@ -13,29 +13,29 @@ def index():
def report_1():
"""First trial
"""
return "report_1"
def report_2():
"""Return the URL arguments
"""
import time
selector = Selector(virtdb.foo1)
# simulate a rather long processing
# simulate a rather long processing
time.sleep(5)
# standard response with the selected values
return dict(test=selector.as_dict(), vars=request.vars)
def report_3():
"""Return the URL arguments
"""
selector = Selector(virtdb.harvester_selector)
response.view = 'reports/report_2.html'
......@@ -44,15 +44,15 @@ def report_3():
def report_4():
"""Execute a javascript in the view using python information
"""
import json
from plugin_dbui import Store
selector = Selector(virtdb.report4)
cfg = Store()
cfg.fields = [dict(name='controller', type='string'),
dict(name='host', type='string'),
dict(name='collections', type='string'),
......@@ -62,16 +62,16 @@ def report_4():
cfg.groupField = 'controller'
cfg.data = []
for row in db().select(db.harvesters.ALL):
di = dict(controller=row.controller,
host='<a href="http://www.web2py.com">%s</a>' % row.host,
collections=row.collections,
ratio=row.ratio)
cfg['data'].append(di)
return dict(msg="Hello world",
cfg_store=json.dumps(cfg),
return dict(msg="Hello world",
cfg_store=json.dumps(cfg),
selector=json.dumps(selector))
......@@ -71,6 +71,6 @@ Base classes
.. autosummary::
:toctree: generated/
Modifier
......@@ -6,7 +6,7 @@ Radiography of the application
The viewport interface
----------------------
The main interface for the application appears in the web browser
The main interface for the application appears in the web browser
when typing the URL ``http(s)://myhost/myapplications`` of the application.
The protocol ``http`` or ``https`` depends on the setting of your web front-end.
......@@ -15,10 +15,10 @@ The protocol ``http`` or ``https`` depends on the setting of your web front-end.
:width: 50%
The viewport widget.
The main interface is a *viewport* with two panels. On the left, the
The main interface is a *viewport* with two panels. On the left, the
*tree panel* lists a series of *nodes* containing *leaves*.
An action is performed by clicking on a leaf.
An action is performed by clicking on a leaf.
The result of the selected action is displayed on the right-side panel.
The typical actions are:
......@@ -29,13 +29,13 @@ The typical actions are:
* handle user roles and privileges.
The viewport is an instance of the ``Ext.container.Viewport`` class.
The configuration of the viewport is described in the Chapter
The configuration of the viewport is described in the Chapter
:ref:`customize viewport`.
The grid interface
------------------
The widget to view the content of a database table, and to interact with it, is
The widget to view the content of a database table, and to interact with it, is
a grid widget. It represent the data in a tabular format of rows and columns
.. figure:: images/fr201.png
......@@ -43,7 +43,7 @@ a grid widget. It represent the data in a tabular format of rows and columns
:width: 50%
The grid widget.
It is a very powerful widget with many functionalities:
* Paging;
......@@ -60,8 +60,8 @@ Its customisation is described in the Chapter :ref:`customize grid`.
The form interface
------------------
The form is the interface to modify the content of a database table. It allows
to create, modify, duplicate and delete records. It is activated via the
The form is the interface to modify the content of a database table. It allows
to create, modify, duplicate and delete records. It is activated via the
context menu of the grid.
.. figure:: images/fr202.png
......@@ -69,7 +69,7 @@ context menu of the grid.
:width: 20%
The context menu of the grid widget.
The widgets associated to each field of a table are displayed
in a row, on a top of each others.
......@@ -78,26 +78,26 @@ in a row, on a top of each others.
:width: 30%
The form widget.
This layout is well suited for table with few fields but it is not appropriated
for table with many fields. In the latter case, it is better to group fields
within ``tabs``.
This layout is well suited for table with few fields but it is not appropriated
for table with many fields. In the latter case, it is better to group fields
within ``tabs``.
.. figure:: images/fr204.png
:align: center
:width: 30%
The form widget in which field are organised in tabular way.
The form widget is an instance of the ``Ext.form.Panel`` class.
Its customization is described in the Chapter :ref:`customize form`.
The model
---------
The model is the central piece of your application. It contains the database
tables definition, the fields validation, as well as the customisation of the
fields, forms and grids widgets. It also setup grid filter, report selector and
The model is the central piece of your application. It contains the database
tables definition, the fields validation, as well as the customisation of the
fields, forms and grids widgets. It also setup grid filter, report selector and
the viewport. The model deals with possible user roles.
In a standard web2py application, the model is located in the directory
......@@ -108,15 +108,15 @@ for complex applications. For each database table, three files are setup:
``db_tablename.py``
the table definition.
``ui_tablename.py``
the configuration of the field, form and grid widgets.
``ux_tablename.py``
the values to be loaded when starting from scratch.
In the rest of this section, a complete example is detailed for an application
with two tables ``people`` and ``countries``.
In the rest of this section, a complete example is detailed for an application
with two tables ``people`` and ``countries``.
The files defining the models are::
......@@ -136,9 +136,9 @@ The files defining the models are::
The content of each file is the following:
**access.py**
define the connection to the database and the *virtual* database
define the connection to the database and the *virtual* database
which will be used to build selectors::
db = DAL('sqlite://storage.sqlite', migrate=True)
virtdb = DAL(None)
......@@ -153,30 +153,30 @@ The content of each file is the following:
undef, undef_id = T(dbui.UNDEF), dbui.UNDEF_ID
The first line imports the ``plugin_dbui`` python module in the model
and gives access to its constants, methods and class.
and gives access to its constants, methods and class.
It should be imported once in the model.
The second line defines some constants.
The file also contains the common setting for all widgets::
tables = ['people',
'countries']
dbui.configure_forms(tables,
dbui.configure_forms(tables,
plugins=['pFormToolTip'],
width=300)
dbui.configure_grids(tables,
dbui.configure_grids(tables,
plugins=['pGridRowEditorConfirmDelete',
'pGridRowEditorContextMenu',
'pGridRowEditorDblClick',
'pGridToolbar'])
The first line activates the fields tooltips and defined the width
for all form widgets. The second one activates the context menu as
for all form widgets. The second one activates the context menu as
well as the tool bar for all grid widgets.
**db_countries.py**
Define the database table related to countries::
......@@ -196,7 +196,7 @@ The content of each file is the following:
Field("note", "text"),
migrate="people.table")
**plugin_dbui.py**
**plugin_dbui.py**
Initialise the default configuration parameters for the plugin_dbui.
This file appears when the ``plugin_dbui`` is installed.
It should not be modified.
......@@ -205,9 +205,9 @@ The content of each file is the following:
Customise the Ext JS widgets associated to the table countries.
It concerns individual field, form, grid and store.
The minimal version is an empty file.
To ease the maintenance, the file can be organised in four sections::
# -*- coding: utf-8 -*-
""" publishers widgets
......@@ -236,7 +236,7 @@ The content of each file is the following:
#
#-------------------------------------------------------------------------------
To sort the countries in alphabetic order in combobox and grid, add in
To sort the countries in alphabetic order in combobox and grid, add in
the last section::
storeModifier = dbui.StoreModifier('countries')
......@@ -245,7 +245,7 @@ The content of each file is the following:
**ui_people.py**
Same as before but for the table people.
**ux_defaults.py**
**ux_defaults.py**
Define the default values for reference fields.
It is recommended to defined them to avoid trouble with the Ext JS ComboBox::
......@@ -253,10 +253,10 @@ The content of each file is the following:
db.countries.insert(id=undef_id, country=undef)
In production is is recommended to rename this file as ``ux_default.py.off``
**vt_people_selector.py**
Setup ``Selector`` which will be used in reports.
In this example the selector is associated to the people allowing to
In this example the selector is associated to the people allowing to
to select them by name or by country::
virtdb.define_table('people_selector',
......@@ -264,7 +264,7 @@ The content of each file is the following:
Field('id countries', 'reference countries', label='Countries'))
virtdb.people_selector.id_countries.requires = IS_IN_DB(db, 'countries.country')
**widgets_viewport.py**
Customise the ``viewport``.
The minimal version has to contains the lines::
......@@ -277,6 +277,6 @@ The content of each file is the following:
viewportModifier = dbui.ViewportModifier()
viewportModifier.add_node(gridNode)
They add a single node in the tree panel named ``Tables``.
It contains one leaf per database table. Clicking on a leaf will give
They add a single node in the tree panel named ``Tables``.
It contains one leaf per database table. Clicking on a leaf will give
access to the content of the table using the grid widget.
......@@ -2,7 +2,7 @@
""" access
setup the connection to the databases
"""
#-------------------------------------------------------------------------------
#
......
......@@ -14,9 +14,9 @@ tp_first = "first page"
tp_last = "last_page"
tp_report_numbers = \
"""List of report identifier separated by comma:
"""List of report identifier separated by comma:
LHCb-PROC-2008-04, arXiv:0906.1516 """
tp_speaker = \
"""The name of the speaker: P.-Y. Smith"""
......
......@@ -15,7 +15,7 @@ fieldsModifier.configure_field('dictionary', headers=['foo', 'faa'],
"integer": 0,
"float": 0.01,
"date": "not implemented"})
fieldsModifier.configure_field('python_code', xtype='xaceeditorfield')
#-------------------------------------------------------------------------------
......
......@@ -11,11 +11,11 @@ fieldsModifier = dbui.FieldsModifier('publications')
fieldsModifier.configure_field('conference_start', format='Y-m-d')
fieldsModifier.configure_field('conference_end', format='Y-m-d')
fieldsModifier.configure_field('year', maxValue=datetime.now().year)
fieldsModifier.merge_fields('first_page',
fieldsModifier.merge_fields('first_page',
'last_page',
fieldLabel=T('Pages'))
fieldsModifier.merge_fields('conference_start',
'conference_end',
fieldLabel=T('Dates'))
......@@ -36,7 +36,7 @@ formModifier.merge_fields('title',
'first_page',
'e_print',
title=T('General'))
formModifier.merge_fields('conference_title',
'conference_url',
'conference_start',
......@@ -44,11 +44,11 @@ formModifier.merge_fields('conference_title',
'id_countries',
'conference_speaker',
title=T('Conference'))
formModifier.merge_fields('report_numbers',
formModifier.merge_fields('report_numbers',
'id_reports',
title=T('Report'))
formModifier.merge_fields('authors_cppm',
'id_teams',
'id_projects',
......@@ -62,7 +62,7 @@ formModifier.set_mapper(dbui.map_tabpanel)
#
# Polish the look and feel of the publication form
# NOTE: the width/height define the size of the window
# NOTE: the width/height define the size of the window
# when running the form from the grid. The defaults defines the height
# of the fieldSet allowing a fine tuning of the form layout.
#
......@@ -102,14 +102,14 @@ tpl = ['<b>{PublicationsTitle}</b><br>',
gridModifier = dbui.GridModifier('publications')
gridModifier.configure(plugins=['pMathJax',
{'ptype': 'pGridRowEditorConfirmDelete',
{'ptype': 'pGridRowEditorConfirmDelete',
'resetFields': ['PublicationsId_projects']}
])
gridModifier.merge_columns('title',
'authors',
'id_collaborations',
gridModifier.merge_columns('title',
'authors',
'id_collaborations',
'id_publishers',
'doi',
'doi',
'volume',
'first_page',
'last_page',
......@@ -141,7 +141,7 @@ gridModifier.append_filter(('id_projects', '==', T('select publications for a gi
gridModifier.append_filter(('id_categories', '==', T('select publications with a given category code')))
gridModifier.append_filter(('authors_cppm', 'contains', T('select publications for a given CPPM author')))
gridModifier.append_filter(('countries.country', 'contains', T('blab blab ....')))
gridModifier.configure_filters(plugins=['pFormToolTip'],
width=300)
......
......@@ -2,7 +2,7 @@
""" defaults
Insert defaults values in the tables
"""
if not db(db.categories.id).count():
db.categories.insert(id=undef_id, code=undef, definition=undef)
......
......@@ -3,7 +3,7 @@
Fill configuration and technical tables with usual values.
It ease the cold start and should be inhibited most of the time.
"""
#------------------------------------------------------------------------------
......@@ -16,78 +16,78 @@
#
if db(db.categories.id).count() == 1:
db.categories.insert(id=2,
db.categories.insert(id=2,
code='ACL',
definition='Articles dans des revues internationales '
'ou nationales avec comité de lecture '
'répertoriées par l’AERES ou dans les '
'bases de données internationales')
db.categories.insert(id=3,
code='ACLN',
db.categories.insert(id=3,
code='ACLN',
definition='Articles dans des revues avec comité de '
'lecture non répertoriées dans des bases '
'de données internationales')
db.categories.insert(id=4,
code='ASCL',
db.categories.insert(id=4,
code='ASCL',
definition='Articles dans des revues '
'sans comité de lecture')
db.categories.insert(id=5,
code='BRE',
db.categories.insert(id=5,
code='BRE',
definition='Brevets');
db.categories.insert(id=6,
code='INV',
db.categories.insert(id=6,
code='INV',
definition='Conférences données à l’invitation du '
'Comité d’organisation dans un congrès '
'national ou international')
db.categories.insert(id=7,
code='ACTI',
db.categories.insert(id=7,
code='ACTI',
definition='Communications avec actes dans un congrès '
'international')
db.categories.insert(id=8,
code='ACTN',
db.categories.insert(id=8,
code='ACTN',
definition='Communications avec actes dans un congrès '
'national')
db.categories.insert(id=9,
code='COM',
db.categories.insert(id=9,
code='COM',
definition='Communications orales sans actes dans un '
'congrès international ou national')
db.categories.insert(id=10,
code='AFF',
db.categories.insert(id=10,
code='AFF',
definition='Communications par affiche dans un '
'congrès international ou national')
db.categories.insert(id=11,
code='OS',
db.categories.insert(id=11,
code='OS',
definition='Ouvrages scientifiques '
'(ou chapitres de ces ouvrages)')
db.categories.insert(id=12,
code='OV',
db.categories.insert(id=12,
code='OV',
definition='Ouvrages de vulgarisation '
'(ou chapitres de ces ouvrages)')
db.categories.insert(id=13,
code='DO',
db.categories.insert(id=13,
code='DO',
definition='Directions d’ouvrages ou de revues')
db.categories.insert(id=14,
code='AP',
db.categories.insert(id=14,
code='AP',
definition="Autres productions : bases de données, "
"logiciels enregistrés, traductions, "
"comptes rendus d’ouvrages,rapports de "
"fouilles, guides techniques, catalogues "
"d’exposition, rapports intermédiaires "
"de grands projets internationaux, ...")
db.categories.insert(id=15,
db.categories.insert(id=15,
code='PRE',
definition="Article soumis à un éditeur "
"mais pas encore publié (preprint)")
......@@ -179,7 +179,7 @@ if db(db.harvesters.id).count() == 0:
collections='find cn d0 and tc c',
id_categories=7,
ratio=0.7)
# H1
db.harvesters.insert(id_teams=5,
id_projects=6,
......
......@@ -27,7 +27,7 @@ virtdb.define_table("foo1",
fieldsModifier = dbui.FieldsModifier('foo1')
fieldsModifier.configure_field('my_axis', emptyText='axis')
fieldsModifier.configure_field('my_granularity', emptyText='granularity')
fieldsModifier.merge_fields('my_axis',
fieldsModifier.merge_fields('my_axis',
'my_granularity',
fieldLabel=T('My_Merge'))
......
......@@ -12,7 +12,7 @@ virtdb.define_table("harvester_selector",
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'),
Field('id_projects', db.projects, label='Project'),
Field('id_teams', db.teams, label='Team'),
Field('id_teams', db.teams, label='Team'),
Field('controller', 'string', label='Harvest'))
virtdb.harvester_selector.id_projects.requires = \
......@@ -29,7 +29,7 @@ IS_IN_DB(db, 'teams.team')
fieldsModifier = dbui.FieldsModifier('harvester_selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start',
fieldsModifier.merge_fields('year_start',
'year_end',
fieldLabel=T('Year'))
......@@ -42,7 +42,7 @@ formModifier = dbui.FormModifier('harvester_selector')
formModifier.link_comboboxes(master=virtdb.harvester_selector.id_projects,
slave=virtdb.harvester_selector.controller,
masterHasSlaveData='harvesters')
formModifier = dbui.FormModifier('harvester_selector')
formModifier.link_comboboxes(master=virtdb.harvester_selector.id_projects,