whitespace and import fixes

This commit is contained in:
Thorsten
2016-04-05 18:40:31 +02:00
parent c6baf3cf60
commit 550fa44f42
15 changed files with 43 additions and 37 deletions

View File

@@ -3,7 +3,7 @@
from os.path import dirname, basename, isfile
from glob import glob
__all__ = [ ]
__all__ = []
for f in glob(dirname(__file__) + "/*.py"):
if not basename(f).startswith('_') and isfile(f):

View File

@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
import random
from common import giphy
from plugin_system import pluginfunction, ptypes
from rate_limit import RATE_FUN, RATE_GLOBAL
@pluginfunction('cake', 'displays a cake ASCII art', ptypes.COMMAND, ratelimit_class=RATE_FUN | RATE_GLOBAL)
def command_cake(argv, **args):
if {'please', 'bitte'}.intersection(set(argv)):

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
import events
import json
@@ -13,9 +12,11 @@ import requests
from lxml import etree
import config
from common import VERSION, giphy, get_nick_from_object
from common import VERSION
from rate_limit import RATE_FUN, RATE_GLOBAL, RATE_INTERACTIVE, RATE_NO_SILENCE, RATE_NO_LIMIT
from plugin_system import pluginfunction, ptypes, plugin_storage
from plugin_system import pluginfunction, ptypes, plugin_storage, plugin_enabled_get, plugin_enabled_set
log = logging.getLogger(__name__)
@pluginfunction('help', 'print help for a command or all known commands', ptypes.COMMAND)
def command_help(argv, **args):
@@ -779,6 +780,7 @@ def repeat_message(argv, **args):
'msg': args['stack'][-1]['body']
}
@pluginfunction('isdown', 'check if a website is reachable', ptypes.COMMAND)
def isdown(argv, **args):
if not argv:
@@ -850,4 +852,3 @@ def poll(argv, **args):
@pluginfunction('vote', 'alias for poll', ptypes.COMMAND)
def vote(argv, **args):
return poll(argv, **args)

View File

@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
import time
import random
import config
from plugin_system import pluginfunction, ptypes
log = logging.getLogger(__name__)
comment_joins_strings = [
"%s: please consider to fix your internet connection"
]
@pluginfunction('comment_joins', 'comments frequent joins', ptypes.MUC_ONLINE)
@config.config_locked
def comment_joins(**args):
@@ -46,4 +47,3 @@ def comment_joins(**args):
user_joins.append(current_timestamp)
config.runtime_config_store['user_joins'][arg_user_key] = user_joins
config.runtimeconf_persist()

View File

@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
import random
from plugin_system import pluginfunction, ptypes
log = logging.getLogger(__name__)
@pluginfunction('excuse', 'prints BOFH style excuses', ptypes.COMMAND)
def command_excuse(argv, **args):

View File

@@ -1,9 +1,12 @@
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
import re
import random
import config
from plugin_system import pluginfunction, ptypes
log = logging.getLogger(__name__)
moin_strings_hi = [
'Hi',
@@ -19,6 +22,7 @@ moin_strings_bye = [
'bye',
]
@pluginfunction('moin', 'parse hi/bye', ptypes.PARSE, enabled=False)
def parse_moin(**args):
for direction in [moin_strings_hi, moin_strings_bye]:
@@ -73,5 +77,3 @@ def command_show_moinlist(argv, **args):
])
)
}

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
import random
import re
@@ -11,6 +10,8 @@ from common import extract_title
from rate_limit import RATE_NO_SILENCE, RATE_GLOBAL, RATE_FUN, RATE_URL
from config import runtimeconf_get
from plugin_system import pluginfunction, ptypes
log = logging.getLogger(__name__)
@pluginfunction('mental_ill', 'parse mental illness', ptypes.PARSE, ratelimit_class=RATE_NO_SILENCE | RATE_GLOBAL)
def parse_mental_ill(**args):

View File

@@ -9,6 +9,7 @@ import time
import config
from plugin_system import pluginfunction, ptypes
@pluginfunction('quiz', 'play quiz', ptypes.COMMAND)
def quiz_control(argv, **args):
usage = """quiz mode usage: "quiz start [secs interval:default 30]", "quiz stop", "quiz rules;

View File

@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
import logging
import time
import config
from common import get_nick_from_object
from plugin_system import pluginfunction, ptypes
log = logging.getLogger(__name__)
import time
import config
from plugin_system import pluginfunction, ptypes
@pluginfunction('send_record', 'delivers previously saved message to user', ptypes.MUC_ONLINE)
@config.config_locked
@@ -21,13 +21,13 @@ def send_record(**args):
return None
response = {
'msg': '%s, there %s %d message%s for you:\n%s' % (
arg_user,
'is' if len(records) == 1 else 'are',
len(records),
'' if len(records) == 1 else 's',
'\n'.join(records)
)
'msg': '%s, there %s %d message%s for you:\n%s' % (
arg_user,
'is' if len(records) == 1 else 'are',
len(records),
'' if len(records) == 1 else 's',
'\n'.join(records)
)
}
user_records.pop(arg_user_key)
@@ -35,6 +35,7 @@ def send_record(**args):
return response
@pluginfunction(
'record', 'record a message for a now offline user (usage: record {user} {some message};'
' {some message} == "previous" to use the last channel message)', ptypes.COMMAND)
@@ -85,4 +86,3 @@ def command_show_recordlist(argv, **args):
)
)
}

View File

@@ -2,12 +2,12 @@
import re
import shlex
import json
import requests
import config
from plugin_system import pluginfunction, ptypes
@pluginfunction('translate', 'translate text fragments, use "translate show" to get a list of languages'
'or "translate that" to get the last message translated (to german)', ptypes.COMMAND)
def translate(argv, **args):