mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added DataFilename.
This commit is contained in:
parent
fb8fc70221
commit
230a0503a2
10
src/conf.py
10
src/conf.py
@ -188,7 +188,6 @@ for (name, s) in registry._cache.iteritems():
|
||||
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
||||
List = ircutils.IrcSet
|
||||
Value = ValidChannel
|
||||
|
||||
def removeChannel(self, channel):
|
||||
removals = []
|
||||
for c in self.value:
|
||||
@ -521,6 +520,15 @@ registerGlobalValue(supybot.directories, 'plugins',
|
||||
'config supybot.directories.plugins [config supybot.directories.plugins],
|
||||
newPluginDirectory'."""))
|
||||
|
||||
class DataFilename(registry.String):
|
||||
def __call__(self):
|
||||
v = registry.String.__call__(self)
|
||||
dataDir = supybot.directories.data()
|
||||
if not v.startswith(dataDir):
|
||||
v = os.path.basename(v)
|
||||
v = os.path.join(dataDir, v)
|
||||
return v
|
||||
|
||||
registerGroup(supybot, 'plugins') # This will be used by plugins, but not here.
|
||||
|
||||
###
|
||||
|
Loading…
Reference in New Issue
Block a user