Skip to content

Commit

Permalink
docs: Fix Trigger autodocing
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Feb 15, 2015
1 parent e8c3223 commit 55142b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 73 deletions.
73 changes: 3 additions & 70 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,76 +376,8 @@ The ``Willie`` class
The ``Trigger`` class
---------------------

.. py:class:: Trigger
.. py:attribute:: sender
The channel (or nick, in a private message) from which the message was
sent.

.. py:attribute:: nick
The nick of the person who sent the message.

.. py:attribute:: event
The event which triggered the message.

.. py:attribute:: bytes
The line which triggered the message.

.. py:attribute:: match
The regular expression `MatchObject`_ for the triggering line.

.. _MatchObject: http://docs.python.org/library/re.html#match-objects
.. _re: http://docs.python.org/library/re.html

.. py:attribute:: group
The ``group`` function of the ``match`` attribute.

See Python `re`_ documentation for details.

.. py:attribute:: groups
The ``groups`` function of the ``match`` attribute.

See Python `re`_ documentation for details.

.. py:attribute:: args
The arguments given to a command.

.. py:attribute:: admin
True if the nick which triggered the command is in Willie's admin list as
defined in the config file.

.. py:attribute:: owner
True if the nick which triggered the command is the owner stated in the
config file.

.. py:attribute:: host
The host which sent the triggering message.

.. py:attribute:: isop
*Availability: 3+, deprecated in 4.1.0*

True if the nick which triggered the command is an op on the channel it was triggered in.
Will always be False if the command was triggered by a private message

.. py:attribute:: isvoice
*Availability: 3+, deprecated in 4.1.0*

True if the nick which triggered the command is voiced on the channel it was triggered in.
Will always be False if the command was triggered by a private message
Will be True if user is an op or half-op, even if they don't have +v
.. autoclass:: willie.trigger.Trigger
:members:

More advanced: ``db`` and ``config``
====================================
Expand Down Expand Up @@ -501,3 +433,4 @@ Indices and tables
* :ref:`modindex`
* :ref:`search`

.. _re: https://docs.python.org/2/library/re.html
7 changes: 4 additions & 3 deletions willie/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ class Trigger(unicode):
"""The IRC event (e.g. ``PRIVMSG`` or ``MODE``) which triggered the
message."""
match = property(lambda self: self._match)
"""The regular expression ``MatchObject_`` for the triggering line.
"""The regular expression `MatchObject`_ for the triggering line.
.. _MatchObject: http://docs.python.org/library/re.html#match-objects"""
group = property(lambda self: self._match.group)
"""The ``group`` function of the ``match`` attribute.
See Python ``re_`` documentation for details."""
See Python `re`_ documentation for details."""
groups = property(lambda self: self._match.groups)
"""The ``groups`` function of the ``match`` attribute.
See Python ``re_`` documentation for details."""
See Python `re`_ documentation for details."""
args = property(lambda self: self._pretrigger.args)
"""
A tuple containing each of the arguments to an event. These are the
Expand Down

0 comments on commit 55142b0

Please sign in to comment.