[wip] changes import to reflect new directory structure

This commit is contained in:
nemunaire 2015-01-03 20:17:46 +01:00
commit 5a6230d844
31 changed files with 202 additions and 174 deletions

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2014 nemunaire
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -18,7 +18,7 @@
import imp
from exception import IRCException
from nemubot.exception import IRCException
def call_game(call, *args, **kargs):
@ -67,7 +67,7 @@ class AbstractHook:
return ret
from hooks.messagehook import MessageHook
from nemubot.hooks.messagehook import MessageHook
last_registered = []
@ -81,8 +81,8 @@ def hook(store, *args, **kargs):
def reload():
import hooks.manager
imp.reload(hooks.manager)
import nemubot.hooks.manager
imp.reload(nemubot.hooks.manager)
import hooks.messagehook
imp.reload(hooks.messagehook)
import nemubot.hooks.messagehook
imp.reload(nemubot.hooks.messagehook)

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2014 nemunaire
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2014 nemunaire
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -18,19 +18,19 @@
import re
from exception import IRCException
import hooks
import message
from nemubot.exception import IRCException
from nemubot.hooks import AbstractHook
import nemubot.message
class MessageHook(hooks.AbstractHook):
class MessageHook(AbstractHook):
"""Class storing hook information, specialized for a generic Message"""
def __init__(self, call, name=None, data=None, regexp=None,
channels=list(), server=None, mtimes=-1, end_call=None):
hooks.AbstractHook.__init__(self, call=call, data=data,
AbstractHook.__init__(self, call=call, data=data,
end_call=end_call, mtimes=mtimes)
self.name = name
@ -40,12 +40,12 @@ class MessageHook(hooks.AbstractHook):
def match(self, msg, server=None):
if not isinstance(msg, message.AbstractMessage):
if not isinstance(msg, nemubot.message.AbstractMessage):
return True
elif isinstance(msg, message.Command):
elif isinstance(msg, nemubot.message.Command):
return self.is_matching(msg.cmd, msg.to, server)
elif isinstance(msg, message.TextMessage):
elif isinstance(msg, nemubot.message.TextMessage):
return self.is_matching(msg.message, msg.to, server)
else:
return False