Remove dead or useless code
This commit is contained in:
parent
9935e038fc
commit
ac33ceb579
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python3.3
|
#!/usr/bin/env python3.3
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
# PYTHON STUFFS #######################################################
|
# PYTHON STUFFS #######################################################
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
@ -147,7 +146,7 @@ def replace_variables(cnts, msg=None):
|
|||||||
resultCnt.append(cnt)
|
resultCnt.append(cnt)
|
||||||
|
|
||||||
for u in sorted(set(unsetCnt), reverse=True):
|
for u in sorted(set(unsetCnt), reverse=True):
|
||||||
k = msg.args.pop(u)
|
msg.args.pop(u)
|
||||||
|
|
||||||
return resultCnt
|
return resultCnt
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -128,7 +128,7 @@ def search(msg):
|
|||||||
res.append_message(s.redirect)
|
res.append_message(s.redirect)
|
||||||
res.append_message(s.answer)
|
res.append_message(s.answer)
|
||||||
res.append_message(s.abstract)
|
res.append_message(s.abstract)
|
||||||
res.append_message([res for res in s.result])
|
res.append_message([r for r in s.result])
|
||||||
|
|
||||||
for rt in s.relatedTopics:
|
for rt in s.relatedTopics:
|
||||||
res.append_message(rt)
|
res.append_message(rt)
|
||||||
|
@ -94,7 +94,7 @@ def cmd_github(msg):
|
|||||||
|
|
||||||
|
|
||||||
@hook("cmd_hook", "github_user")
|
@hook("cmd_hook", "github_user")
|
||||||
def cmd_github(msg):
|
def cmd_github_user(msg):
|
||||||
if not len(msg.args):
|
if not len(msg.args):
|
||||||
raise IRCException("indicate a user name to search")
|
raise IRCException("indicate a user name to search")
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ def cmd_github(msg):
|
|||||||
|
|
||||||
|
|
||||||
@hook("cmd_hook", "github_issue")
|
@hook("cmd_hook", "github_issue")
|
||||||
def cmd_github(msg):
|
def cmd_github_issue(msg):
|
||||||
if not len(msg.args):
|
if not len(msg.args):
|
||||||
raise IRCException("indicate a repository to view its issues")
|
raise IRCException("indicate a repository to view its issues")
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ def cmd_github(msg):
|
|||||||
|
|
||||||
|
|
||||||
@hook("cmd_hook", "github_commit")
|
@hook("cmd_hook", "github_commit")
|
||||||
def cmd_github(msg):
|
def cmd_github_commit(msg):
|
||||||
if not len(msg.args):
|
if not len(msg.args):
|
||||||
raise IRCException("indicate a repository to view its commits")
|
raise IRCException("indicate a repository to view its commits")
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from bs4 import BeautifulSoup
|
|
||||||
|
|
||||||
from nemubot.hooks import hook
|
from nemubot.hooks import hook
|
||||||
from nemubot.exception import IRCException
|
from nemubot.exception import IRCException
|
||||||
from nemubot.tools import web
|
from nemubot.tools import web
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
"""Use MediaWiki API to get pages"""
|
"""Use MediaWiki API to get pages"""
|
||||||
|
|
||||||
import json
|
|
||||||
import re
|
import re
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
@ -18,17 +16,18 @@
|
|||||||
|
|
||||||
"""Progressive display of very long messages"""
|
"""Progressive display of very long messages"""
|
||||||
|
|
||||||
|
# PYTHON STUFFS #######################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import sys
|
|
||||||
|
|
||||||
from nemubot.message import Text, DirectAsk
|
from nemubot.message import Text, DirectAsk
|
||||||
from nemubot.hooks import hook
|
from nemubot.hooks import hook
|
||||||
|
|
||||||
nemubotversion = 3.4
|
|
||||||
|
|
||||||
logger = logging.getLogger("nemubot.response")
|
logger = logging.getLogger("nemubot.response")
|
||||||
|
|
||||||
|
|
||||||
|
# MODULE CORE #########################################################
|
||||||
|
|
||||||
class Response:
|
class Response:
|
||||||
|
|
||||||
def __init__(self, message=None, channel=None, nick=None, server=None,
|
def __init__(self, message=None, channel=None, nick=None, server=None,
|
||||||
@ -237,6 +236,8 @@ class Response:
|
|||||||
SERVERS = dict()
|
SERVERS = dict()
|
||||||
|
|
||||||
|
|
||||||
|
# MODULE INTERFACE ####################################################
|
||||||
|
|
||||||
@hook("all_post")
|
@hook("all_post")
|
||||||
def parseresponse(res):
|
def parseresponse(res):
|
||||||
# TODO: handle inter-bot communication NOMORE
|
# TODO: handle inter-bot communication NOMORE
|
||||||
|
@ -7,7 +7,6 @@ from urllib.parse import urlparse
|
|||||||
|
|
||||||
from nemubot.event import ModuleEvent
|
from nemubot.event import ModuleEvent
|
||||||
from nemubot.exception import IRCException
|
from nemubot.exception import IRCException
|
||||||
from nemubot.hooks import hook
|
|
||||||
from nemubot.tools.web import getNormalizedURL
|
from nemubot.tools.web import getNormalizedURL
|
||||||
from nemubot.tools.xmlparser.node import ModuleState
|
from nemubot.tools.xmlparser.node import ModuleState
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ def cmd_whois(msg):
|
|||||||
js = getJSON(URL_WHOIS % urllib.parse.quote(dom))
|
js = getJSON(URL_WHOIS % urllib.parse.quote(dom))
|
||||||
|
|
||||||
if "ErrorMessage" in js:
|
if "ErrorMessage" in js:
|
||||||
err = js["ErrorMessage"]
|
|
||||||
raise IRCException(js["ErrorMessage"]["msg"])
|
raise IRCException(js["ErrorMessage"]["msg"])
|
||||||
|
|
||||||
whois = js["WhoisRecord"]
|
whois = js["WhoisRecord"]
|
||||||
|
@ -26,7 +26,7 @@ def cmd_choice(msg):
|
|||||||
|
|
||||||
|
|
||||||
@hook("cmd_hook", "choicecmd")
|
@hook("cmd_hook", "choicecmd")
|
||||||
def cmd_choice(msg):
|
def cmd_choicecmd(msg):
|
||||||
if not len(msg.args):
|
if not len(msg.args):
|
||||||
raise IRCException("indicate some command to pick!")
|
raise IRCException("indicate some command to pick!")
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
"""Find information about an SAP transaction codes"""
|
"""Find information about an SAP transaction codes"""
|
||||||
|
|
||||||
import re
|
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
@ -10,7 +9,6 @@ from bs4 import BeautifulSoup
|
|||||||
from nemubot.exception import IRCException
|
from nemubot.exception import IRCException
|
||||||
from nemubot.hooks import hook
|
from nemubot.hooks import hook
|
||||||
from nemubot.tools import web
|
from nemubot.tools import web
|
||||||
from nemubot.tools.web import striphtml
|
|
||||||
|
|
||||||
nemubotversion = 4.0
|
nemubotversion = 4.0
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
from urllib.parse import quote
|
|
||||||
|
|
||||||
from nemubot import context
|
from nemubot import context
|
||||||
from nemubot.exception import IRCException
|
from nemubot.exception import IRCException
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
@ -16,7 +14,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timezone
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from nemubot.hooks.abstract import Abstract
|
|
||||||
from nemubot.hooks.message import Message
|
from nemubot.hooks.message import Message
|
||||||
|
|
||||||
last_registered = []
|
last_registered = []
|
||||||
@ -29,12 +28,12 @@ def hook(store, *args, **kargs):
|
|||||||
|
|
||||||
|
|
||||||
def reload():
|
def reload():
|
||||||
global Abstract, Message
|
global Message
|
||||||
import imp
|
import imp
|
||||||
|
|
||||||
import nemubot.hooks.abstract
|
import nemubot.hooks.abstract
|
||||||
imp.reload(nemubot.hooks.abstract)
|
imp.reload(nemubot.hooks.abstract)
|
||||||
Abstract = nemubot.hooks.abstract.Abstract
|
|
||||||
import nemubot.hooks.message
|
import nemubot.hooks.message
|
||||||
imp.reload(nemubot.hooks.message)
|
imp.reload(nemubot.hooks.message)
|
||||||
Message = nemubot.hooks.message.Message
|
Message = nemubot.hooks.message.Message
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# coding=utf-8
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# coding=utf-8
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Nemubot is a smart and modulable IM bot.
|
# Nemubot is a smart and modulable IM bot.
|
||||||
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user