mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-24 17:30:51 +01:00
utils: drop loadModuleFromFolder; it is unused since bcc84b8618f641c77b0a599de9ab9d24432b8c29
This commit is contained in:
parent
e59d829973
commit
f5633329f8
12
utils.py
12
utils.py
@ -138,14 +138,6 @@ def applyModes(irc, target, changedmodes):
|
|||||||
log.warning("(%s) utils.applyModes is deprecated. Use irc.applyModes() instead!", irc.name)
|
log.warning("(%s) utils.applyModes is deprecated. Use irc.applyModes() instead!", irc.name)
|
||||||
return irc.applyModes(target, changedmodes)
|
return irc.applyModes(target, changedmodes)
|
||||||
|
|
||||||
def loadModuleFromFolder(name, folder):
|
|
||||||
"""
|
|
||||||
Imports and returns a module, if existing, from a specific folder.
|
|
||||||
"""
|
|
||||||
fullpath = os.path.join(folder, '%s.py' % name)
|
|
||||||
m = importlib.machinery.SourceFileLoader(name, fullpath).load_module()
|
|
||||||
return m
|
|
||||||
|
|
||||||
def loadPlugin(name):
|
def loadPlugin(name):
|
||||||
"""
|
"""
|
||||||
Imports and returns the requested plugin.
|
Imports and returns the requested plugin.
|
||||||
@ -294,7 +286,7 @@ class ServiceBot():
|
|||||||
return
|
return
|
||||||
|
|
||||||
irc.reply(text, notice=notice, source=servuid, private=private)
|
irc.reply(text, notice=notice, source=servuid, private=private)
|
||||||
|
|
||||||
def error(self, irc, text, notice=False, private=False):
|
def error(self, irc, text, notice=False, private=False):
|
||||||
"""Replies with an error, as the service in question."""
|
"""Replies with an error, as the service in question."""
|
||||||
servuid = self.uids.get(irc.name)
|
servuid = self.uids.get(irc.name)
|
||||||
@ -303,7 +295,7 @@ class ServiceBot():
|
|||||||
return
|
return
|
||||||
|
|
||||||
irc.error(text, notice=notice, source=servuid, private=private)
|
irc.error(text, notice=notice, source=servuid, private=private)
|
||||||
|
|
||||||
def call_cmd(self, irc, source, text, called_in=None):
|
def call_cmd(self, irc, source, text, called_in=None):
|
||||||
"""
|
"""
|
||||||
Calls a PyLink bot command. source is the caller's UID, and text is the
|
Calls a PyLink bot command. source is the caller's UID, and text is the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user