Pick events class from v4

This commit is contained in:
nemunaire 2014-09-23 22:27:53 +02:00
commit acded35e1a
6 changed files with 82 additions and 49 deletions

View file

@ -16,7 +16,7 @@ API_URL="http://worldcup.sfg.io/%s"
def load(context):
from event import ModuleEvent
add_event(ModuleEvent(func=lambda url: urlopen(url, timeout=10).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
add_event(ModuleEvent(func=lambda url: urlopen(url, timeout=10).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, interval=30))
def help_full ():
@ -66,7 +66,7 @@ def cmd_watch(msg):
def current_match_new_action(match_str, osef):
global DATAS
add_event(ModuleEvent(func=lambda url: urlopen(url).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
add_event(ModuleEvent(func=lambda url: urlopen(url).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, interval=30))
matches = json.loads(match_str)