Commit 78e285be authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

delete-trailing-whitespace

--HG--
branch : stable
parent 19861294506f
......@@ -19,7 +19,7 @@ def header(ustring):
def addrheader(uaddr, uname=None):
# even if an email address should be ascii, encode it using utf8 since
# application tests may generate non ascii email address
addr = uaddr.encode('UTF-8')
addr = uaddr.encode('UTF-8')
if uname:
return '%s <%s>' % (header(uname).encode(), addr)
return addr
......
......@@ -117,7 +117,7 @@ class RQLGeneratorTC(TestCase):
def tearDown(self):
ExecutionPlan._check_permissions = _orig_check_permissions
rqlannotation._select_principal = _orig_select_principal
def set_debug(self, debug):
set_debug(debug)
......
......@@ -7,7 +7,7 @@ Instance creation
-----------------
Now that we created our cube, we can create an instance to view our
application in a web browser. To do so we will use a `all-in-one`
application in a web browser. To do so we will use a `all-in-one`
configuration to simplify things ::
cubicweb-ctl create -c all-in-one mycube myinstance
......@@ -45,8 +45,8 @@ located in :file:`~/etc/cubicweb.d/myinstance/*`. To launch it, you just type ::
The option `-D` specify the *debug mode* : the instance is not running in
server mode and does not disconnect from the termnial, which simplifies debugging
in case the instance is not properly launched. You can see how it looks by
visiting the URL `http://localhost:8080` (the port number depends of your
configuration). To login, please use the cubicweb administrator login/psswd you
visiting the URL `http://localhost:8080` (the port number depends of your
configuration). To login, please use the cubicweb administrator login/psswd you
defined when you created the instance.
To shutdown the instance, Crtl-C in the terminal window is enough.
......
......@@ -9,7 +9,7 @@ What is `Google AppEngine` ?
`Google AppEngine`_ is provided with a partial port of the `Django`
framework, but Google stated at Google IO 2008 that it would not
support a specific Python web framework and that all
community-supported frameworks would be more than welcome [1]_.
community-supported frameworks would be more than welcome [1]_.
Therefore `Logilab`_ ported `CubicWeb` to run on top of `Google AppEngine`'s
datastore.
......@@ -26,7 +26,7 @@ Download the source
Please follow instructions on how to install `CubicWeb` framework
(:ref:`CubicWebInstallation`).
(:ref:`CubicWebInstallation`).
Installation
------------
......@@ -37,7 +37,7 @@ App Engine extension of our framework by running the command ::
cubicweb-ctl newgapp <myapp>
This will create a directory containing ::
`-- myapp/
|-- app.conf
|-- app.yaml
......@@ -73,17 +73,17 @@ This will create a directory containing ::
|-- yams/
`-- yapps/
This skeleton directory is a working `AppEngine` application. You will
recognize the files ``app.yaml`` and ``main.py``. All the rest is the
`CubicWeb` framework and its third-party libraries. You will notice that
`CubicWeb` framework and its third-party libraries. You will notice that
the directory ``cubes`` is a library of reusable cubes.
The main directories that you should know about are:
- ``cubes`` : this is a library of reusable yams cubes. To use
those cubes you will list them in the variable
`included-yams-cubes` of ``app.conf``. See also :ref:`cubes`.
- ``cubes`` : this is a library of reusable yams cubes. To use
those cubes you will list them in the variable
`included-yams-cubes` of ``app.conf``. See also :ref:`cubes`.
- [WHICH OTHER ONES SHOULD BE LISTED HERE?]
Dependencies
......@@ -91,7 +91,7 @@ Dependencies
Before starting anything, please make sure the following packages are installed:
- yaml : by default google appengine is providing yaml; make sure you can
import it. We recommend you create a symbolic link yaml instead of installing
import it. We recommend you create a symbolic link yaml instead of installing
and using python-yaml:
yaml -> full/path/to/google_appengine/lib/yaml/lib/yaml/
- gettext
......@@ -99,12 +99,12 @@ Before starting anything, please make sure the following packages are installed:
Setup
~~~~~
Once you executed ``cubicweb-ctl newgapp <myapp>``, you can use that ``myapp/``
Once you executed ``cubicweb-ctl newgapp <myapp>``, you can use that ``myapp/``
as an application directory and do as follows.
This installation directory provides a configuration for an instance of `CubicWeb`
ported for Google App Engine. It is installed with its own command ``laxctl``
which is a port of the command tool ``cubicweb-ctl`` originally developped for
ported for Google App Engine. It is installed with its own command ``laxctl``
which is a port of the command tool ``cubicweb-ctl`` originally developped for
`CubicWeb`.
You can have the details of available commands by running ::
......@@ -119,7 +119,7 @@ Generating translation files
``myapp/i18n``. To compile the translation files, use the `gettext` tools
or the ``laxctl`` command ::
$ python myapp/bin/laxctl i18ncube
$ python myapp/bin/laxctl i18ncube
$ python myapp/bin/laxctl i18ninstance
Ignore the errors that print "No translation file found for domain
......@@ -132,7 +132,7 @@ Ignore the errors that print "No translation file found for domain
You will never need to add new entries in the translation catalog. Instead we would
recommand you to use ``self.req._("msgId")`` in your application code
to flag new message id to add to the catalog, where ``_`` refers to
xgettext that is used to collect new strings to translate.
xgettext that is used to collect new strings to translate.
While running ``laxctl i18ncube``, new string will be added to the catalogs.
Generating the data directory
......@@ -165,7 +165,7 @@ In ``app.conf`` modify the following variable::
 
# does this application rely on google authentication service or not.
use-google-auth=no
In ``app.yaml`` comment the `login: required` set by default in the handler::
- url: .*
......@@ -187,8 +187,8 @@ On Unix and Windows platforms, run it with the dev_appserver::
$ python /path/to/google_appengine/dev_appserver.py /path/to/myapp/
Once the local server is started, visit `http://MYAPP_URL/_load <http://localhost:8080/_load>`_ and sign in as administrator.
This will initialize the repository and enable you to log in into
Once the local server is started, visit `http://MYAPP_URL/_load <http://localhost:8080/_load>`_ and sign in as administrator.
This will initialize the repository and enable you to log in into
the application and continue the installation.
You should be redirected to a page displaying a message `content initialized`.
......@@ -197,7 +197,7 @@ Initialize the datastore
~~~~~~~~~~~~~~~~~~~~~~~~
You, then, want to visit `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_ .
If you selected not to use google authentication, you will be prompted to a
If you selected not to use google authentication, you will be prompted to a
login form where you should initialize the administrator login (recommended
to use admin/admin at first). You will then be redirected to a page providing
you the value to provide to ``./bin/laxctl --cookie``.
......@@ -212,21 +212,21 @@ in order to handle datastore administration requests.
:alt: displaying the detailed view of the cookie values returned
.. note:: In case you are not redirected to a page providing the
option --cookie value, please visit one more time
.. note:: In case you are not redirected to a page providing the
option --cookie value, please visit one more time
`http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_ .
Once, you have this value, then return to the shell and execute ::
$ python myapp/bin/laxctl db-init --cookie='dev_appserver_login=test@example.com:True; __session=7bbe973a6705bc5773a640f8cf4326cc' localhost:8080
.. note:: In the case you are not using google authentication, the value returned
by `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_
by `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_
will look like :
--cookie='__session=2b45d1a9c36c03d2a30cedb04bc37b6d'
Log out by clicking in the menu at the top right corner
and restart browsing from `http://MYAPP_URL/ <http://localhost:8080>`_
and restart browsing from `http://MYAPP_URL/ <http://localhost:8080>`_
as a normal user.
Unless you did something to change it, http://MYAPP_URL should be
......
......@@ -51,7 +51,7 @@ of configuration file.
RewriteCond %(REQUEST_URI) ^/demo
RewriteRule ^/demo$ /demo/
RewriteRule ^/demo/(.*) http://127.0.0.1:8080/$1 [L,P]
and for the https:::
RewriteCond %(REQUEST_URI) ^/ demo
......
......@@ -35,7 +35,7 @@ For Ubuntu Hardy::
You can now install the required packages with the following command::
apt-get update
apt-get update
apt-get install cubicweb cubicweb-dev
`cubicweb` installs the framework itself, allowing you to create
......@@ -89,12 +89,12 @@ Environment configuration
-------------------------
If you installed `CubicWeb` by cloning the Mercurial forest, then you
will need to update the environment variable PYTHONPATH by adding
will need to update the environment variable PYTHONPATH by adding
the path to the forest ``cubicweb``:
Add the following lines to either `.bashrc` or `.bash_profile` to configure
your development environment ::
export PYTHONPATH=/full/path/to/cubicweb-forest
If you installed the debian packages, no configuration is required.
......@@ -134,34 +134,34 @@ Postgres configuration
$ initdb -D /path/to/pgsql
Once initialized, start the database server Postgres
Once initialized, start the database server Postgres
with the command::
$ postgres -D /path/to/psql
If you cannot execute this command due to permission issues, please
make sure that your username has write access on the database.
::
$ chown username /path/to/pgsql
* The database authentication can be either set to `ident sameuser`
or `md5`.
or `md5`.
If set to `md5`, make sure to use an existing user
of your database.
If set to `ident sameuser`, make sure that your
client's operating system user name has a matching user in
the database. If not, please do as follow to create a user::
$ su
$ su - postgres
$ createuser -s -P username
The option `-P` (for password prompt), will encrypt the password with
the method set in the configuration file ``pg_hba.conf``.
the method set in the configuration file ``pg_hba.conf``.
If you do not use this option `-P`, then the default value will be null
and you will need to set it with::
$ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql"
This login/password will be requested when you will create an
......
......@@ -14,12 +14,12 @@ Navigation
This menu provides you a way to adjust some navigation options depending on
your needs, such as the number of entities to display by page of results.
Follows the detailled list of available options :
* navigation.combobox-limit : maximum number of entities to display in related
combo box (sample format: 23)
* navigation.page-size : maximum number of objects displayed by page of results
* navigation.page-size : maximum number of objects displayed by page of results
(sample format: 23)
* navigation.related-limit : maximum number of related entities to display in
* navigation.related-limit : maximum number of related entities to display in
the primary view (sample format: 23)
* navigation.short-line-size : maximum number of characters in short description
(sample format: 23)
......@@ -47,17 +47,17 @@ Follows the detailled list of available options :
Actions
~~~~~~~
This menu provides a way to configure the context in which you expect the actions
to be displayed to the user and if you want the action to be visible or not.
You must have notice that when you view a list of entities, an action box is
available on the left column which display some actions as well as a drop-down
menu for more actions.
to be displayed to the user and if you want the action to be visible or not.
You must have notice that when you view a list of entities, an action box is
available on the left column which display some actions as well as a drop-down
menu for more actions.
The context available are :
* mainactions : actions listed in the left box
* moreactions : actions listed in the `more` menu of the left box
* addrelated : add actions listed in the left box
* useractions : actions listed in the first section of drop-down menu
* useractions : actions listed in the first section of drop-down menu
accessible from the right corner user login link
* siteactions : actions listed in the second section of drop-down menu
accessible from the right corner user login link
......@@ -65,15 +65,15 @@ The context available are :
Boxes
~~~~~
The application has already a pre-defined set of boxes you can use right away.
The application has already a pre-defined set of boxes you can use right away.
This configuration section allows you to place those boxes where you want in the
application interface to customize it.
application interface to customize it.
The available boxes are :
* actions box : box listing the applicable actions on the displayed data
* boxes_blog_archives_box : box listing the blog archives
* boxes_blog_archives_box : box listing the blog archives
* possible views box : box listing the possible views for the displayed data
......@@ -81,7 +81,7 @@ The available boxes are :
* search box : search box
* startup views box : box listing the configuration options available for
* startup views box : box listing the configuration options available for
the application site, such as `Preferences` and `Site Configuration`
Components
......
......@@ -70,11 +70,11 @@ life easier.
you would not be able to use dbapi. ::
from cubicweb import dbapi
cnx = dbapi.connection(database='instance-id', user='admin', password='admin')
cur = cnx.cursor()
for name in ('Personal', 'Professional', 'Computers'):
cur.execute('INSERT Blog B: B name %s', name)
cnx.commit()
......@@ -28,7 +28,7 @@ Command to create a cube
* ``newcube``, create a new cube on the file system based on the name
given in the parameters. This command create a cube from an application
skeleton that includes default files required for debian packaging.
Command to create an instance
-----------------------------
......@@ -75,7 +75,7 @@ Commands to maintain i18n catalogs
----------------------------------
* ``i18ncubicweb``, regenerates messages catalogs of the `CubicWeb` library
* ``i18ncube``, regenerates the messages catalogs of a cube
* ``i18ninstance``, recompiles the messages catalogs of an instance.
* ``i18ninstance``, recompiles the messages catalogs of an instance.
This is automatically done while upgrading.
See also chapter :ref:`internationalisation`.
......@@ -116,7 +116,7 @@ Create first your new cube cube ::
This will create a new cube in ``/path/to/forest/cubicweb/cubes/<mycube>``
for a Mercurial forest installation, or in ``/usr/share/cubicweb/cubes``
for a debian packages installation, and then create an instance as
for a debian packages installation, and then create an instance as
explained just above.
......@@ -124,7 +124,7 @@ How to implement security?
"""link a version to its project. A version is necessarily linked
to one and only one project. """
# some lines voluntarily missing
permissions = {'read': ('managers', 'users', 'guests',),
permissions = {'read': ('managers', 'users', 'guests',),
'delete': ('managers', ),
'add': ('managers', 'logilab',
RRQLExpression('O require_permission P, P name "add_version",
......@@ -185,10 +185,10 @@ How to update a database after a schema modification?
It depends on what has been modified in the schema.
* Update of an attribute permissions and properties:
* Update of an attribute permissions and properties:
``synchronize_eschema('MyEntity')``.
* Update of a relation permissions and properties:
* Update of a relation permissions and properties:
``synchronize_rschema('MyRelation')``.
* Add an attribute: ``add_attribute('MyEntityType', 'myattr')``.
......@@ -304,7 +304,7 @@ How to format an entity date attribute?
the site configuration panel ``http://appurl/view?vid=systempropertiesform``
and then set ``ui.date`` and/or ``ui.datetime``.
Then in the view code, use::
self.format_date(entity.date_attribute)
Can PostgreSQL and CubicWeb authentication work with kerberos ?
......@@ -315,7 +315,7 @@ Can PostgreSQL and CubicWeb authentication work with kerberos ?
file while leaving the password blank. It should be enough for your instance
to connect to postgresql with a kerberos ticket.
How to load data from a script?
-------------------------------
......@@ -357,7 +357,7 @@ How to reset the password for user joe?
>>> from cubicweb.server.utils import crypt_password
>>> crypt_password('joepass')
'qHO8282QN5Utg'
>>>
>>>
and paste it in the database::
......
......@@ -7,7 +7,7 @@ Part IV - Appendixes
--------------------
The following chapters are reference material.
.. toctree::
:maxdepth: 1
......
......@@ -12,7 +12,7 @@ trees (each revision indicates the changes required to obtain the
next, and so on). Locally, we have a repository containing revisions
tree, and a working directory. It is possible
to put in its working directory, one of the versions of its local repository,
modify and then push it in its repository.
modify and then push it in its repository.
It is also possible to get revisions from another repository or to export
its own revisions from the local repository to another repository.
......@@ -83,7 +83,7 @@ Major commands
hg incoming ssh://myhost//home/src/repo
* See what is the revision of the local repository which has been taken out
* See what is the revision of the local repository which has been taken out
from the working directory and amended::
hg parent
......@@ -114,8 +114,8 @@ Best Practices
Installation of the forest extension
````````````````````````````````````
Set up the forest extension by getting a copy of the sources
from http://hg.akoha.org/hgforest/ and adding the following
Set up the forest extension by getting a copy of the sources
from http://hg.akoha.org/hgforest/ and adding the following
lines to your ``~/.hgrc``: ::
[extensions]
......
......@@ -53,7 +53,7 @@ expression.
relation ::= 'NOT'? VARIABLE R_TYPE COMP_OP? expression
| 'NOT'? R_TYPE VARIABLE 'IN' '(' expression (',' expression)* ')'
expression ::= var_or_func_or_const (MATH_OP var_or_func_or_const) *
| '(' expression ')'
......@@ -83,7 +83,7 @@ expression.
Internal representation (syntactic tree)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The tree research does not contain the selected variables
The tree research does not contain the selected variables
(e.g. there is only what follows "WHERE").
The insertion tree does not contain the variables inserted or relations
......@@ -156,7 +156,7 @@ relations (non-recursive rules)::
Document class Type <-> Document occurence_of Fiche class Type
Sheet class Type <-> Form collection Collection class Type
Therefore 1. becomes::
Document X where
......
......@@ -11,7 +11,7 @@ special relations (in terms of implementation, the language
user should see virtually no difference between an attribute and a
relation).
RQL is inspired by SQL but is the highest level. A knowledge of the
RQL is inspired by SQL but is the highest level. A knowledge of the
`CubicWeb` schema defining the application is necessary.
Comparison with existing languages
......@@ -21,8 +21,8 @@ SQL
```
RQL builds on the features of SQL but is at a higher level
(the current implementation of RQL generates SQL). For that it is limited
to the way of browsing relations and introduces variables.
The user does not need to know the model underlying SQL, but the `CubicWeb`
to the way of browsing relations and introduces variables.
The user does not need to know the model underlying SQL, but the `CubicWeb`
schema defining the application.
Versa
......@@ -30,16 +30,16 @@ Versa
We should look in more detail, but here are already some ideas for
the moment ... Versa_ is the language most similar to what we wanted
to do, but the model underlying data being RDF, there is some
number of things such as namespaces or handling of the RDF types which
number of things such as namespaces or handling of the RDF types which
does not interest us. On the functionality level, Versa_ is very comprehensive
including through many functions of conversion and basic types manipulation,
which may need to be guided at one time or another.
which may need to be guided at one time or another.
Finally, the syntax is a little esoteric.
Sparql
``````
The query language most similar to RQL is SPARQL_, defined by the W3C to serve
for the semantic web.
for the semantic web.
The different types of queries
......@@ -59,7 +59,7 @@ Update entities, create relations (`SET`)
Delete entities or relationship (`DELETE`)
Remove entities or relations existing in the database.
.. _Versa: http://uche.ogbuji.net/tech/rdf/versa/
......
......@@ -81,7 +81,7 @@ Comparison operators
* The operator `=` is the default operator.
* The operator `LIKE` equivalent to `~=` can be used with the
special character `%` in a string to indicate that the chain
special character `%` in a string to indicate that the chain
must start or finish by a prefix/suffix:
::
......@@ -90,11 +90,11 @@ Comparison operators
* The operator `IN` provides a list of possible values:
::
Any X WHERE X name IN ( 'chauvat', 'fayolle', 'di mascio', 'thenault')
XXX nico: "A trick <> 'bar'" wouldn't it be more convenient than
XXX nico: "A trick <> 'bar'" wouldn't it be more convenient than
"NOT A trick 'bar'" ?
.. _PriorityOperators:
......@@ -130,7 +130,7 @@ Search Query
Type of selected variables.
The special type `Any` is equivalent to not specify a type.
:restriction:
list of conditions to test successively
list of conditions to test successively
`V1 relation V2 | <static value>`
:orderterms:
Definition of the selection order: variable or column number followed by
......@@ -167,7 +167,7 @@ Negation
Identity
````````
You can use the special relation `identity` in a query to
You can use the special relation `identity` in a query to
add an identity constraint between two variables. This is equivalent
to ``is`` in python::
......@@ -181,23 +181,23 @@ with `RQLExpressions`.
Limit / offset
``````````````
::
Any P ORDERBY N LIMIT 5 OFFSET 10 WHERE P is Person, P firstname N
Function calls
``````````````
::
Any UPPER(N) WHERE P firstname N
Functions on string: UPPER, LOWER
Exists
``````
::
Any X ORDERBY PN,N
WHERE X num N, X version_of P, P name PN,
WHERE X num N, X version_of P, P name PN,
EXISTS(X in_state S, S name IN ("dev", "ready"))
OR EXISTS(T tags X, T name "priority")
......@@ -219,12 +219,12 @@ Optional relations (Left outer join)
Any C, P WHERE C is Card, P? documented_by C
Any T,P,V WHERE T is Ticket, T concerns P, T done_in V?
Having
``````
::
Any X GROUPBY X WHERE X knows Y HAVING COUNT(Y) > 10
Subqueries
......@@ -232,14 +232,14 @@ Subqueries
::
(Any X WHERE X is Person) UNION (Any X WHERE X is Company)
DISTINCT Any W, REF
WITH W, REF BEING
WITH W, REF BEING
(
(Any W, REF WHERE W is Workcase, W ref REF,
(Any W, REF WHERE W is Workcase, W ref REF,
W concerned_by D, D name "Logilab")
UNION
UNION
(Any W, REF WHERE W is Workcase, W ref REF, '
W split_into WP, WP name "WP1")
)
......@@ -317,7 +317,7 @@ Insertion query
The restriction can define variables used in assignments.
Caution, if a restriction is specified, the insertion is done for
Caution, if a restriction is specified, the insertion is done for
*each line result returned by the restriction*.
- *Insert a new person named 'foo'*
......@@ -331,7 +331,7 @@ Caution, if a restriction is specified, the insertion is done for
INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y
- *Insert a new person named 'foo' and a 'friend' relation with an existing
- *Insert a new person named 'foo' and a 'friend' relation with an existing
person called 'nice'*
::
......@@ -350,7 +350,7 @@ each result line returned by the restriction*.
SET X name 'bar', X first_name 'original' WHERE X is Person, X name 'foo'
- *Insert a relation of type 'know' between objects linked by
- *Insert a relation of type 'know' between objects linked by