mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 07:34:08 +01:00
Merge branch 'master' of ssh://jemfinch@supybot.git.sourceforge.net/gitroot/supybot
This commit is contained in:
commit
278da67295
18
src/conf.py
18
src/conf.py
@ -37,9 +37,6 @@ import supybot.utils as utils
|
||||
import supybot.registry as registry
|
||||
import supybot.ircutils as ircutils
|
||||
|
||||
installDir = os.path.dirname(sys.modules[__name__].__file__)
|
||||
_pluginsDir = os.path.join(installDir, 'plugins')
|
||||
|
||||
###
|
||||
# version: This should be pretty obvious.
|
||||
###
|
||||
@ -737,18 +734,11 @@ registerGlobalValue(supybot.directories.data, 'tmp',
|
||||
utils.file.AtomicFile.default.tmpDir = supybot.directories.data.tmp
|
||||
utils.file.AtomicFile.default.backupDir = supybot.directories.backup
|
||||
|
||||
class PluginDirectories(registry.CommaSeparatedListOfStrings):
|
||||
def __call__(self):
|
||||
v = registry.CommaSeparatedListOfStrings.__call__(self)
|
||||
if _pluginsDir not in v:
|
||||
v.append(_pluginsDir)
|
||||
return v
|
||||
|
||||
registerGlobalValue(supybot.directories, 'plugins',
|
||||
PluginDirectories([], """Determines what directories the bot will
|
||||
look for plugins in. Accepts a comma-separated list of strings. This
|
||||
means that to add another directory, you can nest the former value and add
|
||||
a new one. E.g. you can say: bot: 'config supybot.directories.plugins
|
||||
registry.CommaSeparatedListOfStrings([], """Determines what directories the
|
||||
bot will look for plugins in. Accepts a comma-separated list of strings.
|
||||
This means that to add another directory, you can nest the former value and
|
||||
add a new one. E.g. you can say: bot: 'config supybot.directories.plugins
|
||||
[config supybot.directories.plugins], newPluginDirectory'."""))
|
||||
|
||||
registerGlobalValue(supybot, 'plugins',
|
||||
|
@ -38,13 +38,17 @@ import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
import supybot.callbacks as callbacks
|
||||
|
||||
installDir = os.path.dirname(sys.modules[__name__].__file__)
|
||||
_pluginsDir = os.path.join(installDir, 'plugins')
|
||||
|
||||
class Deprecated(ImportError):
|
||||
pass
|
||||
|
||||
def loadPluginModule(name, ignoreDeprecation=False):
|
||||
"""Loads (and returns) the module for the plugin with the given name."""
|
||||
files = []
|
||||
pluginDirs = conf.supybot.directories.plugins()
|
||||
pluginDirs = conf.supybot.directories.plugins()[:]
|
||||
pluginDirs.append(_pluginsDir)
|
||||
for dir in pluginDirs:
|
||||
try:
|
||||
files.extend(os.listdir(dir))
|
||||
|
Loading…
Reference in New Issue
Block a user