mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Added pydoclink, a command which returns a link to the current documentation
for the specified module
This commit is contained in:
parent
76c4dfc762
commit
b0fa84408e
@ -165,6 +165,15 @@ class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
|||||||
irc.error(msg, 'That function has no documentation.')
|
irc.error(msg, 'That function has no documentation.')
|
||||||
else:
|
else:
|
||||||
irc.error(msg, 'No function or module %s exists.' % name)
|
irc.error(msg, 'No function or module %s exists.' % name)
|
||||||
|
|
||||||
|
def pydoclink(self, irc, msg, args):
|
||||||
|
"""<python module>
|
||||||
|
|
||||||
|
Returns a link to the current documentation for <python module>
|
||||||
|
"""
|
||||||
|
module = privmsgs.getArgs(args)
|
||||||
|
url = 'http://python.org/doc/current/lib/module-%s.html' % module
|
||||||
|
irc.reply(msg, '%s' % url)
|
||||||
|
|
||||||
_these = [str(s) for s in this.s.decode('rot13').splitlines() if s]
|
_these = [str(s) for s in this.s.decode('rot13').splitlines() if s]
|
||||||
_these.pop(0) # Initial line (The Zen of Python...)
|
_these.pop(0) # Initial line (The Zen of Python...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user