Skip to content

Commit

Permalink
[adminchannel, announce, bugzilla] PEP8 #125
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Oct 21, 2014
1 parent 999e577 commit d4f8866
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
21 changes: 11 additions & 10 deletions willie/modules/adminchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
from willie.module import commands, priority, OP, HALFOP
from willie.tools import Nick


def default_mask(trigger):
welcome = formatting.color('Welcome to:', formatting.colors.PURPLE)
chan = formatting.color(trigger.sender, formatting.colors.TEAL)
topic_ = formatting.bold('Topic:')
topic_ = formatting.color('| ' + topic_, formatting.colors.PURPLE)
arg = formatting.color('{}', formatting.colors.GREEN)
return '{} {} {} {}'.format(welcome, chan, topic_, arg)
welcome = formatting.color('Welcome to:', formatting.colors.PURPLE)
chan = formatting.color(trigger.sender, formatting.colors.TEAL)
topic_ = formatting.bold('Topic:')
topic_ = formatting.color('| ' + topic_, formatting.colors.PURPLE)
arg = formatting.color('{}', formatting.colors.GREEN)
return '{} {} {} {}'.format(welcome, chan, topic_, arg)


def setup(bot):
Expand Down Expand Up @@ -266,10 +267,10 @@ def unquiet(bot, trigger):
@priority('high')
def kickban(bot, trigger):
"""
This gives admins the ability to kickban a user.
The bot must be a Channel Operator for this command to work.
.kickban [#chan] user1 user!*@* get out of here
"""
This gives admins the ability to kickban a user.
The bot must be a Channel Operator for this command to work.
.kickban [#chan] user1 user!*@* get out of here
"""
if bot.privileges[trigger.sender][trigger.nick] < OP:
return
if bot.privileges[trigger.sender][bot.nick] < HALFOP:
Expand Down
1 change: 0 additions & 1 deletion willie/modules/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ def announce(bot, trigger):
return
for channel in bot.channels:
bot.msg(channel, '[ANNOUNCEMENT] %s' % trigger.group(2))

9 changes: 5 additions & 4 deletions willie/modules/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

regex = None


def configure(config):
"""
Expand All @@ -42,8 +43,8 @@ def setup(bot):

domains = '|'.join(bot.config.bugzilla.get_list('domains'))
regex = re.compile((r'https?://(%s)'
'(/show_bug.cgi\?\S*?)'
'(id=\d+)')
'(/show_bug.cgi\?\S*?)'
'(id=\d+)')
% domains)
bot.memory['url_callbacks'][regex] = show_bug

Expand All @@ -53,8 +54,8 @@ def shutdown(bot):


@rule(r'.*https?://(\S+?)'
'(/show_bug.cgi\?\S*?)'
'(id=\d+).*')
'(/show_bug.cgi\?\S*?)'
'(id=\d+).*')
def show_bug(bot, trigger, match=None):
"""Show information about a Bugzilla bug."""
match = match or trigger
Expand Down

0 comments on commit d4f8866

Please sign in to comment.