diff --git a/plugins/FunCommands.py b/plugins/FunCommands.py index b548f0143..8a86fd871 100644 --- a/plugins/FunCommands.py +++ b/plugins/FunCommands.py @@ -64,7 +64,7 @@ import ircmsgs import privmsgs import callbacks -example = """ +example = utils.wrapLines(""" @list FunCommands 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 @netstats @@ -144,7 +144,7 @@ example = """ @dns kernel.org 204.152.189.116 @kernel -""" +""") class FunCommands(callbacks.Privmsg): def __init__(self): diff --git a/plugins/Http.py b/plugins/Http.py index f77fee844..7431781d0 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -50,7 +50,7 @@ import privmsgs import callbacks import structures -example = """ +example = utils.wrapLines(""" @list Http acronym, babelize, deepthought, foldoc, freshmeat, geekquote, netcraft, randomlanguage, stockquote, title, translate, weather @acronym ASAP @@ -82,7 +82,7 @@ example = """ Portuguese @babelize en [randomlanguage] [deepthought] # 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): pass diff --git a/plugins/Relay.py b/plugins/Relay.py index 3ef72242b..fd1222c36 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -50,7 +50,7 @@ import ircutils import privmsgs import callbacks -example = """ +example = utils.wrapLines(""" @load Relay jemfinch: The operation succeeded. @startrelay freenode @@ -76,7 +76,7 @@ example = """ jemfinch: relaycolor <0,1,2> @relaywhois GnuVince 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): import socket diff --git a/plugins/URLSnarfer.py b/plugins/URLSnarfer.py index be0a6df2e..c6f88e283 100644 --- a/plugins/URLSnarfer.py +++ b/plugins/URLSnarfer.py @@ -44,10 +44,11 @@ import urlparse import sqlite +import utils import privmsgs import callbacks -example = """ +example = utils.wrapLines(""" lasturl, numurls, randomurl @numurls Error: Command must be sent in a channel or include a channel in its arguments. @@ -66,7 +67,7 @@ example = """ , added by jemfinch at 03:16 PM, August 25, 2003. @lasturl #sourcereview --at coderforums.com , added by Strike|work at 02:41 PM, August 25, 2003. -""" +""") def configure(onStart, afterConnect, advanced): # This will be called by setup.py to configure this module. onStart and diff --git a/src/utils.py b/src/utils.py index d059e4640..ae2bc2280 100755 --- a/src/utils.py +++ b/src/utils.py @@ -41,6 +41,7 @@ import os import re import string import sgmllib +import textwrap import htmlentitydefs class HtmlToText(sgmllib.SGMLParser): @@ -279,4 +280,10 @@ def unCommaThe(s): else: 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: