Easy spacing fixes, trailing stuff

Remove useless trailing \
Remove trailing spaces
Add missing empty lines

autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 .

Diff quickly checked.
This commit is contained in:
Laurent Bachelier 2013-03-15 20:01:49 +01:00
commit 7094931c92
231 changed files with 474 additions and 67 deletions

View file

@ -33,6 +33,7 @@ IRC_NICKNAME = 'boobot'
IRC_SERVER = 'irc.freenode.org'
STORAGE_FILE = 'boobot.storage'
class MyThread(Thread):
def __init__(self, bot):
Thread.__init__(self)
@ -50,9 +51,9 @@ class MyThread(Thread):
self.weboob.loop()
def find_keywords(self, text):
for word in ['weboob', 'videoob', 'havesex', 'havedate', 'monboob', 'boobmsg', \
'flatboob', 'boobill', 'pastoob', 'radioob', 'translaboob', 'traveloob', \
'boobathon', 'boobank', 'boobtracker', 'comparoob', 'wetboobs', \
for word in ['weboob', 'videoob', 'havesex', 'havedate', 'monboob', 'boobmsg',
'flatboob', 'boobill', 'pastoob', 'radioob', 'translaboob', 'traveloob',
'boobathon', 'boobank', 'boobtracker', 'comparoob', 'wetboobs',
'webcontentedit', 'weboorrents', 'capabilit', u'sàt', u'salut à toi']:
if word in text.lower():
return word
@ -80,6 +81,7 @@ class MyThread(Thread):
def stop(self):
self.weboob.want_stop()
class TestBot(SingleServerIRCBot):
def __init__(self, channel, nickname, server, port=6667):
SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname + "`")
@ -121,6 +123,7 @@ class TestBot(SingleServerIRCBot):
if h:
self.send_message(u'Housing: %s (%sm² / %s%s)' % (h.title, h.area, h.cost, h.currency))
def main():
logging.basicConfig(level=logging.DEBUG)
bot = TestBot(IRC_CHANNEL, IRC_NICKNAME, IRC_SERVER)

View file

@ -39,14 +39,18 @@ if sys.stdout.encoding is None:
# end of hack
def removeNonAscii(s): return "".join(i for i in s if ord(i)<128)
rx = re.compile(u'[ \\/\\?\\:\\>\\<\\!\\\\\\*]+', re.UNICODE)
def removeSpecial(s):
return rx.sub(u' ', u'%s' % s)
DOWNLOAD_DIRECTORY=".files"
class Downloadboob:
def __init__(self, backend_name, download_directory, links_directory):

View file

@ -100,7 +100,7 @@ class VideoobWeb(BaseApplication):
page_url=video.page_url,
url=video.url if video.url else '/download?id=%s' % video.id,
thumbnail_url=video.thumbnail.url,
) \
)
for video in backend.search_videos(pattern=q, nsfw=nsfw)]
if videos:
if merge: