Fix some bugs due to module to package change

This commit is contained in:
Némunaire 2012-06-29 20:23:29 +02:00
parent 316e6878ba
commit fdd794ff1b
2 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@
import re import re
import sys import sys
from datetime import timedelta from datetime import timedelta
from datetime import date from datetime import datetime
import time import time
import threading import threading
@ -29,7 +29,7 @@ def load():
DATAS.setIndex("name") DATAS.setIndex("name")
#Load the manager #Load the manager
Manager.save = save Manager.save = save
threadManager = Manager(DATAS, SRVS) threadManager = Manager.Manager(DATAS, SRVS)
threadManager.start() threadManager.start()
def close(): def close():
@ -96,8 +96,7 @@ def parseanswer(msg):
return True return True
elif (msg.cmd[0] == "end" or msg.cmd[0] == "forceend") and len(msg.cmd) > 1: elif (msg.cmd[0] == "end" or msg.cmd[0] == "forceend") and len(msg.cmd) > 1:
if msg.cmd[1] in DATAS.index: if msg.cmd[1] in DATAS.index:
if DATAS.index[msg.cmd[1]].hasAttribute("end"): msg.send_chn ("%s a duré %s." % (msg.cmd[1], msg.just_countdown(datetime.now () - DATAS.index[msg.cmd[1]].getDate("start"))))
msg.send_chn ("%s a duré %s." % (msg.cmd[1], msg.just_countdown(datetime.now () - DATAS.index[msg.cmd[1]].getDate("start"))))
if DATAS.index[msg.cmd[1]]["proprio"] == msg.sender or (msg.cmd[0] == "forceend" and msg.sender == msg.srv.owner): if DATAS.index[msg.cmd[1]]["proprio"] == msg.sender or (msg.cmd[0] == "forceend" and msg.sender == msg.srv.owner):
DATAS.delChild(DATAS.index[msg.cmd[1]]) DATAS.delChild(DATAS.index[msg.cmd[1]])
Manager.newStrendEvt.set() Manager.newStrendEvt.set()

View File

@ -3,7 +3,7 @@
nemubotversion = 3.0 nemubotversion = 3.0
from .Watcher import Watcher from .Watcher import Watcher
from .Site import Site from . import Site
def help_tiny (): def help_tiny ():
"""Line inserted in the response to the command !help""" """Line inserted in the response to the command !help"""
@ -17,11 +17,12 @@ WATCHER = None
def load(): def load():
global WATCHER, DATAS global WATCHER, DATAS, SRVS
#Load the watcher #Load the watcher
Site.SRVS = SRVS
WATCHER = Watcher() WATCHER = Watcher()
for site in DATAS.getNodes("watch"): for site in DATAS.getNodes("watch"):
s = Site(site) s = Site.Site(site)
WATCHER.addServer(s) WATCHER.addServer(s)
WATCHER.start() WATCHER.start()