Added utils.wrapLines and wrapped the lines of each plugin's example.

This commit is contained in:
Jeremy Fincher 2003-08-27 16:25:43 +00:00
parent 8d669471ba
commit b572562cb3
5 changed files with 16 additions and 8 deletions

View File

@ -64,7 +64,7 @@ import ircmsgs
import privmsgs import privmsgs
import callbacks import callbacks
example = """ example = utils.wrapLines("""
<jemfinch> @list FunCommands <jemfinch> @list FunCommands
<supybot> base, binary, calc, chr, coin, cpustats, decode, dice, dns, encode, hexlify, kernel, last, lastfrom, leet, levenshtein, lithp, md5, mimetype, netstats, objects, ord, pydoc, rot13, rpn, sha, soundex, unhexlify, uptime, urlquote, urlunquote, xor <supybot> base, binary, calc, chr, coin, cpustats, decode, dice, dns, encode, hexlify, kernel, last, lastfrom, leet, levenshtein, lithp, md5, mimetype, netstats, objects, ord, pydoc, rot13, rpn, sha, soundex, unhexlify, uptime, urlquote, urlunquote, xor
<jemfinch> @netstats <jemfinch> @netstats
@ -144,7 +144,7 @@ example = """
<jemfinch> @dns kernel.org <jemfinch> @dns kernel.org
<supybot> 204.152.189.116 <supybot> 204.152.189.116
<jemfinch> @kernel <jemfinch> @kernel
""" """)
class FunCommands(callbacks.Privmsg): class FunCommands(callbacks.Privmsg):
def __init__(self): def __init__(self):

View File

@ -50,7 +50,7 @@ import privmsgs
import callbacks import callbacks
import structures import structures
example = """ example = utils.wrapLines("""
<jemfinch> @list Http <jemfinch> @list Http
<supybot> acronym, babelize, deepthought, foldoc, freshmeat, geekquote, netcraft, randomlanguage, stockquote, title, translate, weather <supybot> acronym, babelize, deepthought, foldoc, freshmeat, geekquote, netcraft, randomlanguage, stockquote, title, translate, weather
<jemfinch> @acronym ASAP <jemfinch> @acronym ASAP
@ -82,7 +82,7 @@ example = """
<supybot> Portuguese <supybot> Portuguese
<jemfinch> @babelize en [randomlanguage] [deepthought] <jemfinch> @babelize en [randomlanguage] [deepthought]
<supybot> # 355: When he was a small boy, had always wanted to be one acrobat. It looked at as thus much amusement, turning through air, to launch itself, fulling it it it he himself with the land in the shoulders of the person. Little knew that when finally one was changedded acrobat, would seem irritating thus. Years later, later this that stopped finally, joined did not work to it for it is as one acrobat after everything. Weirdo of the stre <supybot> # 355: When he was a small boy, had always wanted to be one acrobat. It looked at as thus much amusement, turning through air, to launch itself, fulling it it it he himself with the land in the shoulders of the person. Little knew that when finally one was changedded acrobat, would seem irritating thus. Years later, later this that stopped finally, joined did not work to it for it is as one acrobat after everything. Weirdo of the stre
""" """)
class FreshmeatException(Exception): class FreshmeatException(Exception):
pass pass

View File

@ -50,7 +50,7 @@ import ircutils
import privmsgs import privmsgs
import callbacks import callbacks
example = """ example = utils.wrapLines("""
<jemfinch> @load Relay <jemfinch> @load Relay
<supybot> jemfinch: The operation succeeded. <supybot> jemfinch: The operation succeeded.
<jemfinch> @startrelay freenode <jemfinch> @startrelay freenode
@ -76,7 +76,7 @@ example = """
<supybot> jemfinch: relaycolor <0,1,2> <supybot> jemfinch: relaycolor <0,1,2>
<jemfinch> @relaywhois GnuVince <jemfinch> @relaywhois GnuVince
<supybot> jemfinch: Vincent Foley (~vince@modemcable216.89-202-24.mtl.mc.videotron.ca) has been online since 08:37 PM, August 24, 2003 (idle for 1 day, 10 hours, 21 minutes, and 3 seconds) and is on #sourcereview and @#hackcanada <supybot> jemfinch: Vincent Foley (~vince@modemcable216.89-202-24.mtl.mc.videotron.ca) has been online since 08:37 PM, August 24, 2003 (idle for 1 day, 10 hours, 21 minutes, and 3 seconds) and is on #sourcereview and @#hackcanada
""" """)
def configure(onStart, afterConnect, advanced): def configure(onStart, afterConnect, advanced):
import socket import socket

View File

@ -44,10 +44,11 @@ import urlparse
import sqlite import sqlite
import utils
import privmsgs import privmsgs
import callbacks import callbacks
example = """ example = utils.wrapLines("""
<supybot> lasturl, numurls, randomurl <supybot> lasturl, numurls, randomurl
<jemfinch> @numurls <jemfinch> @numurls
<supybot> Error: Command must be sent in a channel or include a channel in its arguments. <supybot> Error: Command must be sent in a channel or include a channel in its arguments.
@ -66,7 +67,7 @@ example = """
<supybot> <http://slashdot.org/comments.pl?sid=75020&cid=6720123>, added by jemfinch at 03:16 PM, August 25, 2003. <supybot> <http://slashdot.org/comments.pl?sid=75020&cid=6720123>, added by jemfinch at 03:16 PM, August 25, 2003.
<jemfinch> @lasturl #sourcereview --at coderforums.com <jemfinch> @lasturl #sourcereview --at coderforums.com
<supybot> <http://coderforums.com/showthread.php?s=&postid=15798#post15798>, added by Strike|work at 02:41 PM, August 25, 2003. <supybot> <http://coderforums.com/showthread.php?s=&postid=15798#post15798>, added by Strike|work at 02:41 PM, August 25, 2003.
""" """)
def configure(onStart, afterConnect, advanced): def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and # This will be called by setup.py to configure this module. onStart and

View File

@ -41,6 +41,7 @@ import os
import re import re
import string import string
import sgmllib import sgmllib
import textwrap
import htmlentitydefs import htmlentitydefs
class HtmlToText(sgmllib.SGMLParser): class HtmlToText(sgmllib.SGMLParser):
@ -279,4 +280,10 @@ def unCommaThe(s):
else: else:
return s return s
def wrapLines(s):
L = []
for line in s.splitlines():
L.append(textwrap.fill(line))
return '\n'.join(L)
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: