mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-09 19:52:37 +01:00
Possibly a bit hackish, but we use registry._cache here to preset some
registry variables so directories the user doesn't want don't get created by conf and log and to prevent log from logging anything non-critical.
This commit is contained in:
parent
7837ee2824
commit
b8d73d98c6
@ -186,10 +186,10 @@ def main():
|
|||||||
specific place you'd like them? If not, just press enter and we'll make
|
specific place you'd like them? If not, just press enter and we'll make
|
||||||
a directory named "logs" right here.""")
|
a directory named "logs" right here.""")
|
||||||
try:
|
try:
|
||||||
registry.cache['supybot.directories.log'] = getDirectoryName(
|
registry._cache['supybot.directories.log'] = getDirectoryName(
|
||||||
registry.cache['supybot.directories.log'])
|
registry._cache['supybot.directories.log'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
registry.cache['supybot.directories.log'] = getDirectoryName('logs')
|
registry._cache['supybot.directories.log'] = getDirectoryName('logs')
|
||||||
|
|
||||||
|
|
||||||
# conf.supybot.directories.data
|
# conf.supybot.directories.data
|
||||||
@ -198,10 +198,10 @@ def main():
|
|||||||
like the bot to put these things? If not, just press enter and we'll make
|
like the bot to put these things? If not, just press enter and we'll make
|
||||||
a directory named "data" right here.""")
|
a directory named "data" right here.""")
|
||||||
try:
|
try:
|
||||||
registry.cache['supybot.directories.data'] = getDirectoryName(
|
registry._cache['supybot.directories.data'] = getDirectoryName(
|
||||||
registry.cache['supybot.directories.data'])
|
registry._cache['supybot.directories.data'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
registry.cache['supybot.directories.data'] = getDirectoryName('data')
|
registry._cache['supybot.directories.data'] = getDirectoryName('data')
|
||||||
|
|
||||||
# conf.supybot.directories.conf
|
# conf.supybot.directories.conf
|
||||||
output("""Your bot must know where to find his configuration files. It'll
|
output("""Your bot must know where to find his configuration files. It'll
|
||||||
@ -209,10 +209,10 @@ def main():
|
|||||||
Where should that place be? If you don't care, just press enter and we'll
|
Where should that place be? If you don't care, just press enter and we'll
|
||||||
make a directory right here named "conf" where it'll store his stuff. """)
|
make a directory right here named "conf" where it'll store his stuff. """)
|
||||||
try:
|
try:
|
||||||
registry.cache['supybot.directories.conf'] = getDirectoryName(
|
registry._cache['supybot.directories.conf'] = getDirectoryName(
|
||||||
registry.cache['supybot.directories.conf'])
|
registry._cache['supybot.directories.conf'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
registry.cache['supybot.directories.conf'] = getDirectoryName('conf')
|
registry._cache['supybot.directories.conf'] = getDirectoryName('conf')
|
||||||
|
|
||||||
# pluginDirs
|
# pluginDirs
|
||||||
output("""Your bot will also need to know where to find his plugins at.
|
output("""Your bot will also need to know where to find his plugins at.
|
||||||
@ -220,7 +220,7 @@ def main():
|
|||||||
your own personal plugins that you write for will probably be somewhere
|
your own personal plugins that you write for will probably be somewhere
|
||||||
else.""")
|
else.""")
|
||||||
try:
|
try:
|
||||||
pluginDirs = registry.cache['supybot.directories.plugins'].split(',')
|
pluginDirs = registry._cache['supybot.directories.plugins'].split(',')
|
||||||
output("""Currently, the bot knows about the following directories:""")
|
output("""Currently, the bot knows about the following directories:""")
|
||||||
for pluginDir in pluginDirs:
|
for pluginDir in pluginDirs:
|
||||||
output(pluginDir)
|
output(pluginDir)
|
||||||
@ -238,17 +238,17 @@ def main():
|
|||||||
pluginDir = getDirectoryName('plugins')
|
pluginDir = getDirectoryName('plugins')
|
||||||
if pluginDir not in pluginDirs:
|
if pluginDir not in pluginDirs:
|
||||||
pluginDirs.append(pluginDir)
|
pluginDirs.append(pluginDir)
|
||||||
registry.cache['supybot.directories.plugins'] = ','.join(pluginDirs)
|
registry._cache['supybot.directories.plugins'] = ','.join(pluginDirs)
|
||||||
|
|
||||||
output("Good! We're done with the directory stuff.")
|
output("Good! We're done with the directory stuff.")
|
||||||
|
|
||||||
# Store the minimum log priority if set, because we set it to a temporary
|
# Store the minimum log priority if set, because we set it to a temporary
|
||||||
# value during the wizard
|
# value during the wizard
|
||||||
try:
|
try:
|
||||||
priority = registry.cache['supybot.log.minimumPriority']
|
priority = registry._cache['supybot.log.minimumPriority']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
priority = 'INFO'
|
priority = 'INFO'
|
||||||
registry.cache['supybot.log.minimumPriority'] = 'CRITICAL'
|
registry._cache['supybot.log.minimumPriority'] = 'CRITICAL'
|
||||||
|
|
||||||
# Now that we're all set, import conf and log
|
# Now that we're all set, import conf and log
|
||||||
import conf
|
import conf
|
||||||
|
Loading…
Reference in New Issue
Block a user