From fdd794ff1b149ae82570afc212e78349efb2ea16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Fri, 29 Jun 2012 20:23:29 +0200 Subject: [PATCH] Fix some bugs due to module to package change --- modules/events/__init__.py | 7 +++---- modules/watchWebsite/__init__.py | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/events/__init__.py b/modules/events/__init__.py index e07819f..5d2c48d 100644 --- a/modules/events/__init__.py +++ b/modules/events/__init__.py @@ -3,7 +3,7 @@ import re import sys from datetime import timedelta -from datetime import date +from datetime import datetime import time import threading @@ -29,7 +29,7 @@ def load(): DATAS.setIndex("name") #Load the manager Manager.save = save - threadManager = Manager(DATAS, SRVS) + threadManager = Manager.Manager(DATAS, SRVS) threadManager.start() def close(): @@ -96,8 +96,7 @@ def parseanswer(msg): return True elif (msg.cmd[0] == "end" or msg.cmd[0] == "forceend") and len(msg.cmd) > 1: 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): DATAS.delChild(DATAS.index[msg.cmd[1]]) Manager.newStrendEvt.set() diff --git a/modules/watchWebsite/__init__.py b/modules/watchWebsite/__init__.py index 25683d0..6842007 100644 --- a/modules/watchWebsite/__init__.py +++ b/modules/watchWebsite/__init__.py @@ -3,7 +3,7 @@ nemubotversion = 3.0 from .Watcher import Watcher -from .Site import Site +from . import Site def help_tiny (): """Line inserted in the response to the command !help""" @@ -17,11 +17,12 @@ WATCHER = None def load(): - global WATCHER, DATAS + global WATCHER, DATAS, SRVS #Load the watcher + Site.SRVS = SRVS WATCHER = Watcher() for site in DATAS.getNodes("watch"): - s = Site(site) + s = Site.Site(site) WATCHER.addServer(s) WATCHER.start()