Skip to content
This repository was archived by the owner on Dec 29, 2017. It is now read-only.

Commit 7f73e12

Browse files
author
Ovv
committed
Update doc for github
1 parent 7569a31 commit 7f73e12

7 files changed

+83
-102
lines changed

CONTRIBUTING.rst

+14-16
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ Contributing
66

77
First off, thanks for taking the time to contribute!
88

9-
Contributions are welcome by anybody and everybody. We are not kidding!
9+
Contributions are welcome by anybody and everybody. We are not kidding! Looking for help ? Join us on `Slack`_ by requesting an `invite`_.
1010

1111
The rest of this document will be guidelines to contributing to the project. Remember that these are just guidelines, not rules. Use common sense as much as possible.
1212

13+
.. _invite: http://pythondevelopers.herokuapp.com/
14+
.. _Slack: https://pythondev.slack.com/
15+
1316
Pull Request Guidelines
1417
-----------------------
1518

@@ -31,7 +34,7 @@ Types of Contributions
3134
Report Bugs
3235
^^^^^^^^^^^
3336

34-
Report bugs at https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/issues.
37+
Report bugs at https://github.com/pyslackers/sir-bot-a-lot/issues.
3538

3639
If you are reporting a bug, please include:
3740

@@ -42,26 +45,21 @@ If you are reporting a bug, please include:
4245
Bugs & Features
4346
^^^^^^^^^^^^^^^
4447

45-
Look through the gitlab issues for bugs or features request.
46-
Anything tagged with "bug" or "enhancement" is open to whoever wants to implement it.
48+
Look through the github issues for bugs or features request.
49+
Anything tagged with "help-wanted" is open to whoever wants to implement it.
4750

48-
At this point you might want to pop on the #bots and #community-projects channel of the `python developers slack community`_.
49-
Request an `invite`_.
50-
51-
.. _invite: http://pythondevelopers.herokuapp.com/
52-
.. _python developers slack community: https://pythondev.slack.com/
5351

5452
Write Documentation
5553
^^^^^^^^^^^^^^^^^^^
5654

57-
sir-bot-a-lot could always use more documentation, whether as part of the
58-
official sir-bot-a-lot docs, in docstrings, or even on the web in blog posts,
55+
Sir Bot-a-lot could always use more documentation, whether as part of the
56+
official Sir Bot-a-lot docs, in docstrings, or even on the web in blog posts,
5957
articles, and such.
6058

6159
Submit Feedback
6260
^^^^^^^^^^^^^^^
6361

64-
The best way to send feedback is to file an issue at https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/issues.
62+
The best way to send feedback is to file an issue at https://github.com/pyslackers/sir-bot-a-lot/issues.
6563

6664
If you are proposing a feature:
6765

@@ -75,12 +73,12 @@ Get Started!
7573

7674
Ready to contribute? Here's how to set up `sir-bot-a-lot` for local development.
7775

78-
1. Fork the `sir-bot-a-lot` repo on gitlab.
76+
1. Fork the `sir-bot-a-lot` repo on github.
7977
2. Clone your fork locally:
8078

8179
.. code-block:: console
8280
83-
$ git clone git@gitlab.com:your_name_here/sir-bot-a-lot.git
81+
$ git clone git@github.com:<username>/sir-bot-a-lot.git
8482
8583
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
8684

@@ -106,15 +104,15 @@ Ready to contribute? Here's how to set up `sir-bot-a-lot` for local development.
106104
107105
To get tox, just pip install it into your virtualenv.
108106

109-
6. Commit your changes and push your branch to gitlab:
107+
6. Commit your changes and push your branch to github:
110108

111109
.. code-block:: console
112110
113111
$ git add .
114112
$ git commit -m "Your detailed description of your changes."
115113
$ git push origin name-of-your-bugfix-or-feature
116114
117-
7. Submit a pull request through the gitlab website.
115+
7. Submit a pull request through the github website.
118116

119117
Git Hygiene
120118
-----------

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ History
55
2016-08-20
66
----------
77

8-
Initial commit of Sir-bot-a-lot
8+
Initial commit of Sir Bot-a-lot

docs/usage.rst docs/configuration.rst

+22-25
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
=====================
2-
Usage & Configuration
3-
=====================
1+
=============
2+
Configuration
3+
=============
44

55
Command Line
66
------------
77

8-
To start Sir-bot-a-lot you can use:
8+
To start Sir Bot-a-lot you can use:
99

1010
.. code-block:: console
1111
@@ -18,30 +18,31 @@ or:
1818
$ python run.py
1919
2020
21-
2221
Arguments
2322
^^^^^^^^^
2423

2524
The command line arguments take precedence over the configuration file.
2625

2726
* :code:`-h --help`: Help message
28-
* :code:`-p --port`: Port where to run Sir-bot-a-lot
29-
* :code:`-c --config`: Path to Sir-bot-a-lot Yaml config file
27+
* :code:`-P --port`: Port where to run Sir Bot-a-lot
28+
* :code:`-c --config`: Path to Sir Bot-a-lot Yaml config file
29+
* :code:`-u --update`: Perform update migration if necessary (i.e. database)
30+
* :code:`-p --plugins`: Plugins to start
3031

3132

3233
Environment variables
3334
---------------------
3435
The environment variable take precedence over the command line arguments and the
3536
configuration file.
3637

37-
* :code:`SIRBOT_PORT`: Port where to run Sir-bot-a-lot
38-
* :code:`SIRBOT_CONFIG`: Path to Sir-bot-a-lot Yaml config file
38+
* :code:`SIRBOT_PORT`: Port where to run Sir Bot-a-lot
39+
* :code:`SIRBOT_CONFIG`: Path to Sir Bot-a-lot Yaml config file
3940

4041

4142
Configuration file
4243
------------------
4344

44-
Sir-bot-a-lot configuration is a Yaml file containing the core and all the
45+
Sir Bot-a-lot configuration is a Yaml file containing the core and all the additional
4546
plugins configuration.
4647

4748
The environment variable and command line arguments take precedence over the
@@ -51,41 +52,37 @@ A basic configuration will look like this:
5152

5253
.. code-block:: yaml
5354
54-
port: 8080
55-
56-
core:
57-
plugins:
58-
- plugin-1
59-
- plugin-2
55+
.. code-block:: yaml
6056
61-
plugin-1:
57+
sirbot:
58+
port: 8080
59+
plugins: []
60+
plugin1:
6261
...
63-
64-
plugin-2:
62+
plugin2:
6563
...
6664
6765
Starting priority
6866
^^^^^^^^^^^^^^^^^
6967

70-
As plugins can depend on other plugins startup is done by priority. By default all plugins have a priority of 50.
71-
Plugins with a higher priority will start before the one with a lower priority.
68+
Plugins can be dependant on other plugins. You can ensure a startup order by setting a startup priority. By default all plugins have a priority of 50. Plugins with a higher priority will start before the one with a lower priority.
7269

73-
If multiple plugins have the same priority they will start at the same time.
70+
If multiple plugins have the same priority they will start simultaneously.
7471

7572
The priority can be set to false to disable a plugin.
7673

7774
.. code-block:: yaml
7875
79-
plugin-1:
76+
plugin1:
8077
priority: 80
81-
plugin-2:
78+
plugin2:
8279
priority: False
8380
8481
Logging
8582
^^^^^^^
8683

8784
Logging can be configured in the :code:`logging` key of the configuration file.
88-
It use the logging module `dictionnary configuration`_.
85+
It use the logging module `dictionnary configuration`_. By default the log level is set to :code:`INFO`.
8986

9087
Each plugin should define his own logger. The core logger is :code:`sirbot.core`.
9188

docs/facade.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
Facade
33
======
44

5-
The MainFacade object is the way to access other plugin functionality.
6-
Each plugin should expose a facade.
7-
8-
To request a plugin facade:
5+
The facade manager is the way to access other plugin functionality by requesting a plugin facade:
96

107
.. code-block:: python
118
12-
plugin_facade = main_facade.get('my_plugin')
9+
plugin_facade = facade.get('my_plugin')
10+
11+
A new plugin facade is created for each call to the :code:`Facade.get` method
1312

14-
A new plugin facade is created for each called to the :code:`MainFacade.get` method
13+
Each incoming request should create a new facade manager object by calling :code:`facade.new()`

docs/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
contain the root `toctree` directive.
55
66
=========================================
7-
Welcome to sir-bot-a-lot's documentation!
7+
Welcome to Sir Bot-a-lot's documentation!
88
=========================================
99

10-
A slack bot built for the people and by the people of the `python developers slack community`_.
10+
An asynchronous bot framework built for the people and by the people of the `python developers slack community`_.
1111
Want to join? `Get an invite`_ !
1212

1313
.. toctree::
1414
:maxdepth: 2
1515

1616
quickstart
1717
installation
18-
usage
18+
configuration
1919
plugins
2020
facade
2121
contributing

docs/plugins.rst

+27-12
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,54 @@ Available plugins
1010
-----------------
1111

1212
* `Slack`_
13-
* `Pythondev plugins repositorie`_
13+
* `Github`_
14+
* `SQLite`_
15+
* `Others`_
1416

15-
.. _Slack: http://sirbot-plugin-slack.readthedocs.io/en/latest/
16-
.. _Pythondev plugins repositorie: https://gitlab.com/PythonDevCommunity/sirbot-plugin
17+
.. _Slack: https://github.com/pyslackers/sirbot-slack
18+
.. _Github: https://github.com/pyslackers/sirbot-plugins
19+
.. _SQLite: https://github.com/pyslackers/sirbot-plugins
20+
.. _Others: https://github.com/pyslackers/sirbot-plugins
1721

1822
.. _writing_plugins:
1923

2024
Writing plugins
2125
---------------
2226

23-
Sir-bot-a-lot is build onto the `pluggy`_ library for plugins management.
27+
Sir Bot-a-lot is build onto the `pluggy`_ library for plugin management.
2428

2529
.. _pluggy: https://github.com/pytest-dev/pluggy
2630

2731

28-
A plugin must define one hook returning the plugin name and a subclass of the plugin class.
32+
A plugin must define one hook returning a subclass of the plugin class.
2933

3034
.. literalinclude:: ../sirbot/hookspecs.py
3135

3236

3337
.. literalinclude:: ../sirbot/plugin.py
3438

3539

40+
Facade
41+
^^^^^^
42+
43+
If needed a plugin can expose a facade to Sir Bot-a-lot allowing other plugins access to its functionality.
44+
45+
A new facade instance is created each time a plugin request it.
46+
3647
Example
3748
^^^^^^^
3849

39-
The `giphy`_ plugin provide a simple facade for the `Giphy.com`_ API.
50+
The `pypi`_ plugin provide a simple facade for the `Python Package Index`_ API.
4051
It can be retrieve inside another plugin with:
4152

4253
.. code-block:: python
43-
44-
facades.get('giphy')
45-
46-
47-
.. _giphy: https://gitlab.com/PythonDevCommunity/sirbot-plugin/blob/master/sirbot_plugin/giphy.py
48-
.. _Giphy.com: http://giphy.com/
54+
55+
# Create a new giphy facade by calling
56+
# PyPIPlugin.facade()
57+
pypi = facades.get('pypi')
58+
59+
# The pypi plugin facade only expose the search function
60+
result = await pypi.search('sir-bot-a-lot')
61+
62+
.. _pypi: https://github.com/pyslackers/sirbot-plugins/blob/master/sirbot/plugins/pypi.py
63+
.. _Python Package Index: https://pypi.python.org/pypi

docs/quickstart.rst

+11-39
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,14 @@
22
Quick Start
33
===========
44

5-
|build| |coverage| |doc|
6-
7-
A slack bot built for the people and by the people of the `python developers slack community`_.
8-
9-
Want to join? `Get an invite`_ !
10-
11-
.. _Get an invite: http://pythondevelopers.herokuapp.com/
12-
.. _python developers slack community: https://pythondev.slack.com/
13-
.. |build| image:: https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/badges/master/build.svg
14-
:alt: Build status
15-
:scale: 100%
16-
:target: https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/commits/master
17-
.. |coverage| image:: https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/badges/master/coverage.svg
18-
:alt: Coverage status
19-
:scale: 100%
20-
:target: https://gitlab.com/PythonDevCommunity/sir-bot-a-lot/commits/master
21-
.. |doc| image:: https://readthedocs.org/projects/sir-bot-a-lot/badge/?version=latest
22-
:alt: Documentation status
23-
:target: http://sir-bot-a-lot.readthedocs.io/en/latest/?badge=latest
24-
255
Installation
266
------------
277

28-
The sources for sir-bot-a-lot can be downloaded from the `gitlab repo`_.
8+
The sources for Sir Bot-a-lot can be downloaded from the `github repo`_.
299

3010
.. code-block:: console
3111
32-
$ git clone git://gitlab.com/PythonDevCommunity/sir-bot-a-lot
12+
$ git clone https://github.com/pyslackers/sir-bot-a-lot.git
3313
3414
Once you have a copy of the source, you can install it with:
3515

@@ -39,39 +19,31 @@ Once you have a copy of the source, you can install it with:
3919
4020
More installation instruction can be found :ref:`here <installation>`.
4121

42-
.. _gitlab repo: https://gitlab.com/PythonDevCommunity/sir-bot-a-lot
22+
.. _github repo: https://github.com/pyslackers/sir-bot-a-lot
4323

4424
Run
4525
---
4626

47-
To start Sir-bot-a-lot use the command
27+
To start Sir Bot-a-lot use the command
4828

4929
.. code-block:: console
5030
5131
$ sirbot
5232
53-
By default no plugins are installed so Sir-bot-a-lot will not do anything.
33+
By default no plugins are installed so Sir Bot-a-lot will not do anything.
5434
Check out the :ref:`available plugins page <available_plugins>`.
5535

5636
Configuration
5737
-------------
5838

59-
The configuration file is where you tell which plugins to be load.
39+
To load a custom config file use the :code:`--config` argument or the :code:`SIRBOT_CONFIG` environment variable with the configuration file path.
6040

61-
A basic configuration will look like this:
41+
The default configuration file look like this:
6242

6343
.. code-block:: yaml
6444
65-
loglevel: 10
45+
sirbot:
6646
port: 8080
67-
core:
68-
loglevel: 10
69-
plugins:
70-
- plugin-1
71-
- plugin-2
72-
73-
plugin-1:
74-
loglevel: 10
75-
76-
plugin-2:
77-
loglevel: 10
47+
plugins: []
48+
49+
Plugins can also be added with the `--plugins` argument

0 commit comments

Comments
 (0)