Don't import some nemubot module automatically

This commit is contained in:
nemunaire 2015-01-04 23:57:09 +01:00
parent 7c7b63634b
commit 06c85289e0
29 changed files with 30 additions and 9 deletions

View File

@ -7,6 +7,7 @@ import sys
from datetime import datetime, timezone
import shlex
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.message import TextMessage, Command

View File

@ -6,6 +6,7 @@ import re
import sys
from datetime import date, datetime
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools.countdown import countdown_format
from nemubot.tools.date import extractDate

View File

@ -4,6 +4,7 @@
from datetime import datetime, timezone
from nemubot.event import ModuleEvent
from nemubot.hooks import hook
from nemubot.tools.countdown import countdown_format

View File

@ -4,6 +4,7 @@
import urllib
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -6,6 +6,7 @@ from collections import defaultdict
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web
from nemubot.tools.web import striphtml

View File

@ -10,6 +10,7 @@ import time
import threading
import traceback
from nemubot.exception import IRCException
from nemubot.event import ModuleEvent
from nemubot.hooks import hook
from nemubot.tools.date import extractDate

View File

@ -5,6 +5,7 @@
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -5,6 +5,7 @@
import re
import urllib.parse
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -5,6 +5,7 @@
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.tools import web
nemubotversion = 3.4

View File

@ -6,6 +6,7 @@ import json
import re
import urllib.parse
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -2,6 +2,7 @@
"""Various network tools (w3m, w3c validator, curl, traceurl, ...)"""
from nemubot.exception import IRCException
from nemubot.hooks import hook
nemubotversion = 3.4
@ -16,8 +17,6 @@ from . import whois
def load(context):
for mod in [isup, page, w3c, watchWebsite, whois]:
mod.IRCException = IRCException
mod.ModuleEvent = ModuleEvent
mod.add_event = add_event
mod.del_event = del_event
mod.save = save

View File

@ -5,6 +5,7 @@ import tempfile
import urllib
from nemubot import __version__
from nemubot.exception import IRCException
from nemubot.tools import web

View File

@ -2,6 +2,7 @@ import json
import urllib
from nemubot import __version__
from nemubot.exception import IRCException
def validator(url):
"""Run the w3c validator on the given URL

View File

@ -4,6 +4,8 @@ from random import randint
import urllib.parse
from urllib.parse import urlparse
from nemubot.event import ModuleEvent
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools.xmlparser.node import ModuleState

View File

@ -1,6 +1,7 @@
import datetime
import urllib
from nemubot.exception import IRCException
from nemubot.tools.web import getJSON
from more import Response

View File

@ -2,6 +2,7 @@
"""Informe les usagers des prochains passages des transports en communs de la RATP"""
from nemubot.exception import IRCException
from nemubot.hooks import hook
from more import Response

View File

@ -4,6 +4,7 @@
import re
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -4,6 +4,7 @@
import random
from nemubot.exception import IRCException
from nemubot.hooks import hook
nemubotversion = 3.4

View File

@ -5,6 +5,7 @@
import re
import urllib.parse
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web
from nemubot.tools.web import striphtml

View File

@ -9,6 +9,7 @@ import urllib.error
import urllib.request
import urllib.parse
from nemubot.exception import IRCException
from nemubot.hooks import hook
nemubotversion = 3.4

View File

@ -5,6 +5,7 @@
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from .pyaspell import Aspell

View File

@ -5,6 +5,7 @@
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -1,6 +1,7 @@
from datetime import datetime
import urllib
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import human
from nemubot.tools.web import getJSON

View File

@ -5,6 +5,7 @@
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.tools import web
nemubotversion = 3.4

View File

@ -4,6 +4,7 @@
import re
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -6,6 +6,7 @@ import datetime
import re
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.tools import web

View File

@ -8,6 +8,7 @@ import re
from urllib.parse import quote
from urllib.request import urlopen
from nemubot.exception import IRCException
from nemubot.hooks import hook
nemubotversion = 3.4
@ -17,7 +18,7 @@ from more import Response
API_URL="http://worldcup.sfg.io/%s"
def load(context):
from event import ModuleEvent
from nemubot.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, interval=30))

View File

@ -6,6 +6,7 @@ import re
from urllib.parse import urlparse
from urllib.parse import quote
from nemubot.exception import IRCException
from nemubot.hooks import hook
from nemubot.message import TextMessage
from nemubot.tools import web

View File

@ -25,8 +25,6 @@ import os
import sys
from nemubot import __version__
from nemubot.event import ModuleEvent
from nemubot.exception import IRCException
import nemubot.hooks
from nemubot.message import TextMessage
from nemubot.tools.xmlparser import parse_file, module_state
@ -153,10 +151,6 @@ class ModuleLoader(SourceFileLoader):
module.save = lambda: False
module.CONF = self.config
module.ModuleEvent = ModuleEvent
module.ModuleState = module_state.ModuleState
module.IRCException = IRCException
# Load dependancies
if module.CONF is not None and module.CONF.hasNode("dependson"):
module.MODS = dict()