Start fixing bugs into QD module

This commit is contained in:
Némunaire 2012-07-06 10:51:30 +02:00
parent 2e8e58a4a1
commit 84378d7e70

View File

@ -1,13 +1,14 @@
# coding=utf-8 # coding=utf-8
import re import re
import imp
from datetime import datetime from datetime import datetime
nemubotversion = 3.0 nemubotversion = 3.0
from . import GameUpdater from . import GameUpdater
from .QDWrapper import QDWrapper from . import QDWrapper
from .Score import Score from . import Score
channels = "#nemutest #42sh #ykar #epitagueule" channels = "#nemutest #42sh #ykar #epitagueule"
LASTSEEN = dict () LASTSEEN = dict ()
@ -18,12 +19,17 @@ SCORES = None
def load(): def load():
global DATAS, SCORES, CONF global DATAS, SCORES, CONF
DATAS.setIndex("name", "player") DATAS.setIndex("name", "player")
SCORES = QDWrapper(DATAS) SCORES = QDWrapper.QDWrapper(DATAS)
GameUpdater.SCORES = SCORES GameUpdater.SCORES = SCORES
GameUpdater.CONF = CONF GameUpdater.CONF = CONF
GameUpdater.save = save GameUpdater.save = save
GameUpdater.getUser = getUser GameUpdater.getUser = getUser
def reload():
imp.reload(GameUpdater)
imp.reload(QDWrapper)
imp.reload(Score)
def help_tiny (): def help_tiny ():
"""Line inserted in the response to the command !help""" """Line inserted in the response to the command !help"""
@ -134,7 +140,7 @@ def rev (tupl):
def getUser(name): def getUser(name):
global SCORES global SCORES
if name not in SCORES: if name not in SCORES:
SCORES[name] = Score() SCORES[name] = Score.Score()
return SCORES[name] return SCORES[name]