Let's work on 0.3

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
The Pynuts class no more inherits from flask.Flask

All flask.Flask arguments are removed from the Pynuts __init__
method.
The only argument left is `app`, a Flask application.
This argument will be stored as self.app. Thus, the application
configuration and methods will be accessible through a Pynuts
instance.
Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Default configuration keys defined in Pynuts __init__ method

Default configuration keys (`CSRF_ENABLED`,
PYNUTS_DOCUMENT_REPOSITORY` and `UPLOADS_DEFAULT_DEST`) are
defined in the Pynuts `__init__` method.

As the Pynuts object is to be instanciated after the Flask application,
as the latter is passed as a parameter at init, if the user set
these configuration keys in the Flask config, the user configuration
will be left untouched.

To do son we use the builtin dict.setdefault method.

See also: http://docs.python.org/2/library/stdtypes.html#dict.setdefault

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Git repo creation logic defined in the document_repository property

If the git repository (and/or the parent directories) does not exist,
create it and init it.

If if already exists, return the pre-existent repository.

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Jinja loader associated to the application, instead of Pynuts instance

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
`before_request`  hook attached to application, instead of Pynuts instance

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
SQLAlchemy object no more directly attached to the Pynuts instance.
Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Relocation of reflect functon

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Useless property

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
A document can access both the Pynuts and Flask instances

All Pynuts documents can access to both the Pynuts and Flask
instances, respectively through the _pynuts and _app proxies.

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Separation of Flask app and Pynuts object

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Separation of Flask and Pynuts propagated in the example code
Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
tests __init__ file adapted to Flask/Pynuts separation

Each time setup_fixture is called, a Flask app is first created,
then a SQLAlchemy ORM is associated to it, the Flask
app is passed as an argument during the Pynuts init,
and finally, the Pynuts Git repo is initialized.

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
app → nuts

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
The add_upload_sets is called through the Pynuts instance

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Initialization of repo in Pynuts.__init__

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
The git repository is not initialized when executing Pynuts.__init__

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Un-used args & kwargs

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Pynuts separated from Flask - Simple example updated

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>
Pynuts separated from Flask: quickstart example updated

Signed-off-by: Balthazar Rouberol <balthazar.rouberol@kozea.fr>