Few fixes.

This commit is contained in:
Antoine Nguyen
2016-10-19 09:45:30 +02:00
parent 1b23b0c7e4
commit 0af78cff3f
5 changed files with 66 additions and 32 deletions
+11 -17
View File
@@ -2,28 +2,22 @@
How to contribute
#################
Contributions are always welcome but please try to follow those few rules:
Contributions are always welcome. If you want to submit a patch,
please respect the following rules:
- Modoboa tries to respect the `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_
- Open a pull request on the appropriate repository
- Respect `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_
- Document your patch and respect `PEP 257 <https://www.python.org/dev/peps/pep-0257/>`_
- Add unit tests and make sure the global coverage does not decrease
- If you add some code, add some tests too. You can run the tests
suite locally by using `tox <https://testrun.org/tox/latest/config.html>`_
There are also a few commands that can help you to contribute:
Start a basic Modoboa instance with a few fixture::
$ tox -e serve
You can log in with admin/password.
Build the docs to see your changes::
$ tox -e doc
$ firefox .tox/doc/tmp/html/index.html
If all those steps are validated, your contribution will generally be
integrated.
Table of contents
=================
.. toctree::
:maxdepth: 1
contributing/getting_started
contributing/plugin_api
+42 -5
View File
@@ -1,6 +1,6 @@
###############################
Development recipes for Modoboa
###############################
###########
Useful tips
###########
You would like to work on Modoboa but you don't know where to start?
You're at the right place! Browse this page to learn useful tips.
@@ -51,8 +51,9 @@ You're ready to go!
Manage static files
===================
Modoboa uses `bower <http://bower.io/>`_ (thanks to `django-bower <https://github.com/nvbn/django-bower>`_)
to manage its CSS and javascript dependencies.
Modoboa uses `bower <http://bower.io/>`_ (thanks to `django-bower
<https://github.com/nvbn/django-bower>`_) to manage its CSS and
javascript dependencies.
Those dependencies are listed in a file called :file:`dev_settings.py`
located inside the :file:`<path_to_local_copy>/modoboa/core`
@@ -66,6 +67,42 @@ If you want to add a new dependency, just complete the
It will download and store the required files into the
:file:`<path_to_local_copy>/modoboa/bower_components` directory.
Test your modifications
=======================
If you deployed a specific instance for your development needs, you
can run the tests suite as follows:
.. sourcecode:: bash
> python manage.py test modoboa.core modoboa.lib modoboa.admin modoboa.limits modoboa.relaydomains
Otherwise, you can run the tests suite from the repository using `tox
<https://tox.readthedocs.io>`_.
Start a basic Modoboa instance
==============================
From the repository, run the following command to launch a simple
instance with a few fixtures:
.. sourcecode:: bash
> tox -e serve
You can use admin/password to log in.
Build the documentation
=======================
If you need to modify the documenation and want to see the result, you
can build it as follows:
.. sourcecode:: bash
> tox -e doc
> firefox .tox/doc/tmp/html/index.html
FAQ
===
+10 -10
View File
@@ -1,5 +1,5 @@
###################
Adding a new plugin
Create a new plugin
###################
************
@@ -14,19 +14,20 @@ implementation provides the following possibilities:
* Register callback actions for specific events
Plugins are nothing more than Django applications with an extra piece
of code that integrates them into Modoboa. The *modo_extension.py* file
will contain a complete description of the plugin:
of code that integrates them into Modoboa. The
:file:`modo_extension.py` file will contain a complete description of
the plugin:
* Admin and user parameters
* Observed events
* Custom menu entries
The communication between both applications is provided by
:ref:`events`. Modoboa offers some kind of hooks to let plugin add custom
actions.
:ref:`events`. Modoboa offers some kind of hooks to let plugins add
custom actions.
The following subsections describe plugin architecture and explain
how you can create your own plugin.
The following subsections describe the plugin architecture and explain
how you can create your own.
*****************
The required glue
@@ -45,7 +46,6 @@ of the future extension::
class MyExtension(ModoExtension):
"""My custom Modoboa extension."""
name = "myext"
@@ -82,9 +82,9 @@ Parameters
A plugin can declare its own parameters. There are two levels available:
* 'Administration' parameters : used to configure the plugin, editable
inside the *Admin > Settings > Parameters* page,
inside the *Admin > Settings > Parameters* page
* 'User' parameters : per-user parameters (or preferences), editable
inside the *Options > Preferences* page.
inside the *Options > Preferences* page
Playing with parameters
=======================
+2
View File
@@ -34,6 +34,8 @@ Then, install Modoboa:
(env)> pip install modoboa
.. _database:
Database
--------
+1
View File
@@ -1,3 +1,4 @@
factory-boy>=2.4
testfixtures==4.7.0
httmock==1.2.5
tox