Added DataFilename.

This commit is contained in:
Jeremy Fincher 2004-07-28 02:56:08 +00:00
parent fb8fc70221
commit 230a0503a2

View File

@ -188,7 +188,6 @@ for (name, s) in registry._cache.iteritems():
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf): class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
List = ircutils.IrcSet List = ircutils.IrcSet
Value = ValidChannel Value = ValidChannel
def removeChannel(self, channel): def removeChannel(self, channel):
removals = [] removals = []
for c in self.value: for c in self.value:
@ -521,6 +520,15 @@ registerGlobalValue(supybot.directories, 'plugins',
'config supybot.directories.plugins [config supybot.directories.plugins], 'config supybot.directories.plugins [config supybot.directories.plugins],
newPluginDirectory'.""")) 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. registerGroup(supybot, 'plugins') # This will be used by plugins, but not here.
### ###