Continue to clean up docstrings
This commit is contained in:
parent
72fa7b23ba
commit
d449acb57b
7 changed files with 54 additions and 46 deletions
|
|
@ -118,7 +118,7 @@ quickstrict:
|
||||||
|
|
||||||
local:
|
local:
|
||||||
make _check-env
|
make _check-env
|
||||||
make clean
|
#make clean
|
||||||
make _autodoc-index
|
make _autodoc-index
|
||||||
make _html-build
|
make _html-build
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
|
||||||
|
|
@ -277,17 +277,18 @@ class SshProtocol(Manhole, session.Session):
|
||||||
text (str): The first argument is always the text string to send. No other arguments
|
text (str): The first argument is always the text string to send. No other arguments
|
||||||
are considered.
|
are considered.
|
||||||
Keyword Args:
|
Keyword Args:
|
||||||
options (dict): Send-option flags
|
options (dict): Send-option flags:
|
||||||
- mxp: Enforce MXP link support.
|
|
||||||
- ansi: Enforce no ANSI colors.
|
- mxp: Enforce MXP link support.
|
||||||
- xterm256: Enforce xterm256 colors, regardless of TTYPE setting.
|
- ansi: Enforce no ANSI colors.
|
||||||
- nocolor: Strip all colors.
|
- xterm256: Enforce xterm256 colors, regardless of TTYPE setting.
|
||||||
- raw: Pass string through without any ansi processing
|
- nocolor: Strip all colors.
|
||||||
(i.e. include Evennia ansi markers but do not
|
- raw: Pass string through without any ansi processing
|
||||||
convert them into ansi tokens)
|
(i.e. include Evennia ansi markers but do not
|
||||||
- echo: Turn on/off line echo on the client. Turn
|
convert them into ansi tokens)
|
||||||
off line echo for client, for example for password.
|
- echo: Turn on/off line echo on the client. Turn
|
||||||
Note that it must be actively turned back on again!
|
off line echo for client, for example for password.
|
||||||
|
Note that it must be actively turned back on again!
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# print "telnet.send_text", args,kwargs # DEBUG
|
# print "telnet.send_text", args,kwargs # DEBUG
|
||||||
|
|
|
||||||
|
|
@ -388,18 +388,19 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||||
text (str): The first argument is always the text string to send. No other arguments
|
text (str): The first argument is always the text string to send. No other arguments
|
||||||
are considered.
|
are considered.
|
||||||
Keyword Args:
|
Keyword Args:
|
||||||
options (dict): Send-option flags
|
options (dict): Send-option flags:
|
||||||
- mxp: Enforce MXP link support.
|
|
||||||
- ansi: Enforce no ANSI colors.
|
- mxp: Enforce MXP link support.
|
||||||
- xterm256: Enforce xterm256 colors, regardless of TTYPE.
|
- ansi: Enforce no ANSI colors.
|
||||||
- noxterm256: Enforce no xterm256 color support, regardless of TTYPE.
|
- xterm256: Enforce xterm256 colors, regardless of TTYPE.
|
||||||
- nocolor: Strip all Color, regardless of ansi/xterm256 setting.
|
- noxterm256: Enforce no xterm256 color support, regardless of TTYPE.
|
||||||
- raw: Pass string through without any ansi processing
|
- nocolor: Strip all Color, regardless of ansi/xterm256 setting.
|
||||||
(i.e. include Evennia ansi markers but do not
|
- raw: Pass string through without any ansi processing
|
||||||
convert them into ansi tokens)
|
(i.e. include Evennia ansi markers but do not
|
||||||
- echo: Turn on/off line echo on the client. Turn
|
convert them into ansi tokens)
|
||||||
off line echo for client, for example for password.
|
- echo: Turn on/off line echo on the client. Turn
|
||||||
Note that it must be actively turned back on again!
|
off line echo for client, for example for password.
|
||||||
|
Note that it must be actively turned back on again!
|
||||||
|
|
||||||
"""
|
"""
|
||||||
text = args[0] if args else ""
|
text = args[0] if args else ""
|
||||||
|
|
|
||||||
|
|
@ -177,11 +177,13 @@ class SessionHandler(dict):
|
||||||
send-instruction, with the keyword itself being the name
|
send-instruction, with the keyword itself being the name
|
||||||
of the instruction (like "text"). Suitable values for each
|
of the instruction (like "text"). Suitable values for each
|
||||||
keyword are:
|
keyword are:
|
||||||
- arg -> [[arg], {}]
|
::
|
||||||
- [args] -> [[args], {}]
|
|
||||||
- {kwargs} -> [[], {kwargs}]
|
arg -> [[arg], {}]
|
||||||
- [args, {kwargs}] -> [[arg], {kwargs}]
|
[args] -> [[args], {}]
|
||||||
- [[args], {kwargs}] -> [[args], {kwargs}]
|
{kwargs} -> [[], {kwargs}]
|
||||||
|
[args, {kwargs}] -> [[arg], {kwargs}]
|
||||||
|
[[args], {kwargs}] -> [[args], {kwargs}]
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
kwargs (dict): A cleaned dictionary of cmdname:[[args],{kwargs}] pairs,
|
kwargs (dict): A cleaned dictionary of cmdname:[[args],{kwargs}] pairs,
|
||||||
|
|
@ -761,7 +763,7 @@ class ServerSessionHandler(SessionHandler):
|
||||||
Given a client identification hash (for session types that offer them)
|
Given a client identification hash (for session types that offer them)
|
||||||
return all sessions with a matching hash.
|
return all sessions with a matching hash.
|
||||||
|
|
||||||
Args
|
Args:
|
||||||
csessid (str): The session hash.
|
csessid (str): The session hash.
|
||||||
Returns:
|
Returns:
|
||||||
sessions (list): The sessions with matching .csessid, if any.
|
sessions (list): The sessions with matching .csessid, if any.
|
||||||
|
|
@ -827,7 +829,7 @@ class ServerSessionHandler(SessionHandler):
|
||||||
"""
|
"""
|
||||||
Split incoming data into its inputfunc counterparts.
|
Split incoming data into its inputfunc counterparts.
|
||||||
This should be called by the serversession.data_in
|
This should be called by the serversession.data_in
|
||||||
as sessionhandler.call_inputfunc(self, **kwargs).
|
as `sessionhandler.call_inputfunc(self, **kwargs)`.
|
||||||
|
|
||||||
We also intercept OOB communication here.
|
We also intercept OOB communication here.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,24 @@
|
||||||
This module brings Django Signals into Evennia. These are events that
|
This module brings Django Signals into Evennia. These are events that
|
||||||
can be subscribed to by importing a given Signal and using the
|
can be subscribed to by importing a given Signal and using the
|
||||||
following code.
|
following code.
|
||||||
|
::
|
||||||
|
|
||||||
THIS_SIGNAL.connect(callback, sender_object)
|
THIS_SIGNAL.connect(callback, sender_object`)
|
||||||
|
|
||||||
When other code calls THIS_SIGNAL.send(sender, **kwargs), the callback
|
When other code calls `THIS_SIGNAL.send(sender, **kwargs)`, the callback
|
||||||
will be triggered.
|
will be triggered.
|
||||||
|
|
||||||
Callbacks must be in the following format:
|
Callbacks must be in the following format:
|
||||||
|
::
|
||||||
|
|
||||||
def my_callback(sender, **kwargs):
|
def my_callback(sender, **kwargs):
|
||||||
...
|
...
|
||||||
|
|
||||||
This is used on top of hooks to make certain features easier to
|
This is used on top of hooks to make certain features easier to
|
||||||
add to contribs without necessitating a full takeover of hooks
|
add to contribs without necessitating a full takeover of hooks
|
||||||
that may be in high demand.
|
that may be in high demand.
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from django.dispatch import Signal
|
from django.dispatch import Signal
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -596,6 +596,7 @@ class AttributeHandler(object):
|
||||||
*args (tuple): Each argument should be a tuples (can be of varying
|
*args (tuple): Each argument should be a tuples (can be of varying
|
||||||
length) representing the Attribute to add to this object.
|
length) representing the Attribute to add to this object.
|
||||||
Supported tuples are
|
Supported tuples are
|
||||||
|
|
||||||
- `(key, value)`
|
- `(key, value)`
|
||||||
- `(key, value, category)`
|
- `(key, value, category)`
|
||||||
- `(key, value, category, lockstring)`
|
- `(key, value, category, lockstring)`
|
||||||
|
|
@ -847,9 +848,9 @@ def initialize_nick_templates(in_template, out_template):
|
||||||
matched by the in_template.
|
matched by the in_template.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
regex (regex): Regex to match against strings
|
(regex, str): Regex to match against strings and a template
|
||||||
template (str): Template with markers {arg1}, {arg2}, etc for
|
Template with markers `{arg1}`, `{arg2}`, etc for
|
||||||
replacement using the standard .format method.
|
replacement using the standard `.format` method.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
NickTemplateInvalid: If the in/out template does not have a matching
|
NickTemplateInvalid: If the in/out template does not have a matching
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,15 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
||||||
|
|
||||||
# Attribute manager methods
|
# Attribute manager methods
|
||||||
def get_attribute(
|
def get_attribute(
|
||||||
self, key=None, category=None, value=None, strvalue=None, obj=None, attrtype=None, **kwargs
|
self, key=None, category=None, value=None, strvalue=None,
|
||||||
):
|
obj=None, attrtype=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Return Attribute objects by key, by category, by value, by
|
Return Attribute objects by key, by category, by value, by
|
||||||
strvalue, by object (it is stored on) or with a combination of
|
`strvalue`, by object (it is stored on) or with a combination of
|
||||||
those criteria.
|
those criteria.
|
||||||
|
|
||||||
Attrs:
|
Args:
|
||||||
key (str, optional): The attribute's key to search for
|
key (str, optional): The attribute's key to search for.
|
||||||
category (str, optional): The category of the attribute(s)
|
category (str, optional): The category of the attribute(s)
|
||||||
to search for.
|
to search for.
|
||||||
value (str, optional): The attribute value to search for.
|
value (str, optional): The attribute value to search for.
|
||||||
|
|
@ -52,7 +52,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
||||||
precedence if given.
|
precedence if given.
|
||||||
obj (Object, optional): On which object the Attribute to
|
obj (Object, optional): On which object the Attribute to
|
||||||
search for is.
|
search for is.
|
||||||
attrype (str, optional): An attribute-type to search for.
|
attrtype (str, optional): An attribute-type to search for.
|
||||||
By default this is either `None` (normal Attributes) or
|
By default this is either `None` (normal Attributes) or
|
||||||
`"nick"`.
|
`"nick"`.
|
||||||
kwargs (any): Currently unused. Reserved for future use.
|
kwargs (any): Currently unused. Reserved for future use.
|
||||||
|
|
@ -84,7 +84,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
||||||
"""
|
"""
|
||||||
Get a nick, in parallel to `get_attribute`.
|
Get a nick, in parallel to `get_attribute`.
|
||||||
|
|
||||||
Attrs:
|
Args:
|
||||||
key (str, optional): The nicks's key to search for
|
key (str, optional): The nicks's key to search for
|
||||||
category (str, optional): The category of the nicks(s) to search for.
|
category (str, optional): The category of the nicks(s) to search for.
|
||||||
value (str, optional): The attribute value to search for. Note that this
|
value (str, optional): The attribute value to search for. Note that this
|
||||||
|
|
@ -170,7 +170,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
||||||
Return Tag objects by key, by category, by object (it is
|
Return Tag objects by key, by category, by object (it is
|
||||||
stored on) or with a combination of those criteria.
|
stored on) or with a combination of those criteria.
|
||||||
|
|
||||||
Attrs:
|
Args:
|
||||||
key (str, optional): The Tag's key to search for
|
key (str, optional): The Tag's key to search for
|
||||||
category (str, optional): The Tag of the attribute(s)
|
category (str, optional): The Tag of the attribute(s)
|
||||||
to search for.
|
to search for.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue