Enable strict/explicit code highlighting
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
.. currentmodule:: fbchat
|
.. module:: fbchat
|
||||||
.. highlight:: python
|
|
||||||
.. _api:
|
.. _api:
|
||||||
|
|
||||||
.. Note: we're using () to hide the __init__ method where relevant
|
.. Note: we're using () to hide the __init__ method where relevant
|
||||||
|
11
docs/conf.py
11
docs/conf.py
@@ -54,12 +54,7 @@ master_doc = "index"
|
|||||||
# This pattern also affects html_static_path and html_extra_path.
|
# This pattern also affects html_static_path and html_extra_path.
|
||||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||||
|
|
||||||
rst_prolog = """
|
rst_prolog = ".. currentmodule:: " + project
|
||||||
.. highlight:: python
|
|
||||||
.. currentmodule:: {}
|
|
||||||
""".format(
|
|
||||||
project
|
|
||||||
)
|
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
@@ -70,6 +65,10 @@ default_role = "any"
|
|||||||
#
|
#
|
||||||
nitpicky = True
|
nitpicky = True
|
||||||
|
|
||||||
|
# Prefer strict Python highlighting
|
||||||
|
#
|
||||||
|
highlight_language = "python3"
|
||||||
|
|
||||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||||
#
|
#
|
||||||
add_function_parentheses = False
|
add_function_parentheses = False
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
.. highlight:: sh
|
|
||||||
.. _install:
|
.. _install:
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
@@ -7,7 +6,9 @@ Installation
|
|||||||
Pip Install fbchat
|
Pip Install fbchat
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
To install fbchat, run this command::
|
To install fbchat, run this command:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
$ pip install fbchat
|
$ pip install fbchat
|
||||||
|
|
||||||
@@ -21,16 +22,22 @@ Get the Source Code
|
|||||||
fbchat is developed on GitHub, where the code is
|
fbchat is developed on GitHub, where the code is
|
||||||
`always available <https://github.com/carpedm20/fbchat>`_.
|
`always available <https://github.com/carpedm20/fbchat>`_.
|
||||||
|
|
||||||
You can either clone the public repository::
|
You can either clone the public repository:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
$ git clone git://github.com/carpedm20/fbchat.git
|
$ git clone git://github.com/carpedm20/fbchat.git
|
||||||
|
|
||||||
Or, download a `tarball <https://github.com/carpedm20/fbchat/tarball/master>`_::
|
Or, download a `tarball <https://github.com/carpedm20/fbchat/tarball/master>`_:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
$ curl -OL https://github.com/carpedm20/fbchat/tarball/master
|
$ curl -OL https://github.com/carpedm20/fbchat/tarball/master
|
||||||
# optionally, zipball is also available (for Windows users).
|
# optionally, zipball is also available (for Windows users).
|
||||||
|
|
||||||
Once you have a copy of the source, you can embed it in your own Python
|
Once you have a copy of the source, you can embed it in your own Python
|
||||||
package, or install it into your site-packages easily::
|
package, or install it into your site-packages easily:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
$ python setup.py install
|
$ python setup.py install
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
.. highlight:: sh
|
|
||||||
.. _testing:
|
.. _testing:
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
@@ -14,7 +13,9 @@ To use the tests, copy ``tests/data.json`` to ``tests/my_data.json`` or type the
|
|||||||
Please remember to test all supported python versions.
|
Please remember to test all supported python versions.
|
||||||
If you've made any changes to the 2FA functionality, test it with a 2FA enabled account.
|
If you've made any changes to the 2FA functionality, test it with a 2FA enabled account.
|
||||||
|
|
||||||
If you only want to execute specific tests, pass the function names in the command line (not including the ``test_`` prefix). Example::
|
If you only want to execute specific tests, pass the function names in the command line (not including the ``test_`` prefix). Example:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
$ python tests.py sendMessage sessions sendEmoji
|
$ python tests.py sendMessage sessions sendEmoji
|
||||||
|
|
||||||
|
@@ -99,11 +99,11 @@ class Message(object):
|
|||||||
|
|
||||||
Returns a `Message` object, with the formatted string and relevant mentions.
|
Returns a `Message` object, with the formatted string and relevant mentions.
|
||||||
|
|
||||||
>>> Message.formatMentions("Hey {!r}! My name is {}", ("1234", "Peter"), ("4321", "Michael"))
|
>>> Message.formatMentions("Hey {!r}! My name is {}", ("1234", "Peter"), ("4321", "Michael"))
|
||||||
<Message (None): "Hey 'Peter'! My name is Michael", mentions=[<Mention 1234: offset=4 length=7>, <Mention 4321: offset=24 length=7>] emoji_size=None attachments=[]>
|
<Message (None): "Hey 'Peter'! My name is Michael", mentions=[<Mention 1234: offset=4 length=7>, <Mention 4321: offset=24 length=7>] emoji_size=None attachments=[]>
|
||||||
|
|
||||||
>>> Message.formatMentions("Hey {p}! My name is {}", ("1234", "Michael"), p=("4321", "Peter"))
|
>>> Message.formatMentions("Hey {p}! My name is {}", ("1234", "Michael"), p=("4321", "Peter"))
|
||||||
<Message (None): 'Hey Peter! My name is Michael', mentions=[<Mention 4321: offset=4 length=5>, <Mention 1234: offset=22 length=7>] emoji_size=None attachments=[]>
|
<Message (None): 'Hey Peter! My name is Michael', mentions=[<Mention 4321: offset=4 length=5>, <Mention 1234: offset=22 length=7>] emoji_size=None attachments=[]>
|
||||||
"""
|
"""
|
||||||
result = ""
|
result = ""
|
||||||
mentions = list()
|
mentions = list()
|
||||||
|
Reference in New Issue
Block a user