mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
whitespace fixes
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
|
||||
import time
|
||||
import random
|
||||
|
||||
import config
|
||||
from plugin_system import pluginfunction, ptypes
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
comment_joins_strings = [
|
||||
@@ -18,7 +17,7 @@ comment_joins_strings = [
|
||||
def comment_joins(**args):
|
||||
# max elapsed time between the latest and the N latest join
|
||||
timespan = 120
|
||||
max_joins = 6
|
||||
max_joins = config.runtime_config_store
|
||||
|
||||
current_timestamp = int(time.time())
|
||||
|
||||
@@ -26,7 +25,7 @@ def comment_joins(**args):
|
||||
arg_user_key = arg_user.lower()
|
||||
|
||||
if arg_user_key not in config.runtime_config_store['user_joins']:
|
||||
config.runtime_config_store['user_joins'][arg_user_key] = [ current_timestamp ]
|
||||
config.runtime_config_store['user_joins'][arg_user_key] = [current_timestamp]
|
||||
config.runtimeconf_persist()
|
||||
return None
|
||||
|
||||
@@ -42,7 +41,7 @@ def comment_joins(**args):
|
||||
config.runtime_config_store['user_joins'].pop(arg_user_key)
|
||||
config.runtimeconf_persist()
|
||||
log.info("send comment on join")
|
||||
return { 'msg': random.choice(comment_joins_strings) % arg_user }
|
||||
return {'msg': random.choice(comment_joins_strings) % arg_user}
|
||||
else:
|
||||
user_joins.append(current_timestamp)
|
||||
config.runtime_config_store['user_joins'][arg_user_key] = user_joins
|
||||
|
||||
Reference in New Issue
Block a user