mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Made it a bit more user-friendly and useful; added owner user creation.
This commit is contained in:
parent
b640aa746b
commit
2404efa59c
@ -65,8 +65,12 @@ from fix import *
|
|||||||
import os
|
import os
|
||||||
import imp
|
import imp
|
||||||
import conf
|
import conf
|
||||||
|
import ircdb
|
||||||
sys.path.insert(0, conf.pluginDir)
|
sys.path.insert(0, conf.pluginDir)
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
###
|
||||||
|
# Basic stuff.
|
||||||
|
###
|
||||||
name = anything('What would you like to name your config file?')
|
name = anything('What would you like to name your config file?')
|
||||||
if not name.endswith('.conf'):
|
if not name.endswith('.conf'):
|
||||||
name += '.conf'
|
name += '.conf'
|
||||||
@ -82,7 +86,10 @@ if __name__ == '__main__':
|
|||||||
configfd.write('load UserCommands\n')
|
configfd.write('load UserCommands\n')
|
||||||
configfd.write('load ChannelCommands\n')
|
configfd.write('load ChannelCommands\n')
|
||||||
configfd.write('load MiscCommands\n')
|
configfd.write('load MiscCommands\n')
|
||||||
# Now's where we load the modules.
|
|
||||||
|
###
|
||||||
|
# Modules.
|
||||||
|
###
|
||||||
if yn('Would you like to see a list of the available modules?') == 'y':
|
if yn('Would you like to see a list of the available modules?') == 'y':
|
||||||
filenames = os.listdir(conf.pluginDir)
|
filenames = os.listdir(conf.pluginDir)
|
||||||
plugins = []
|
plugins = []
|
||||||
@ -98,6 +105,10 @@ if __name__ == '__main__':
|
|||||||
print module.__doc__
|
print module.__doc__
|
||||||
if yn('Would you like to add this plugin?') == 'y':
|
if yn('Would you like to add this plugin?') == 'y':
|
||||||
configfd.write('load %s\n' % plugin)
|
configfd.write('load %s\n' % plugin)
|
||||||
|
|
||||||
|
###
|
||||||
|
# Commands
|
||||||
|
###
|
||||||
preConnect = 'Would you like any commands to run ' \
|
preConnect = 'Would you like any commands to run ' \
|
||||||
'before the bot connects to the server?'
|
'before the bot connects to the server?'
|
||||||
while yn(preConnect) == 'y':
|
while yn(preConnect) == 'y':
|
||||||
@ -114,6 +125,20 @@ if __name__ == '__main__':
|
|||||||
configfd.write(anything('What command?'))
|
configfd.write(anything('What command?'))
|
||||||
configfd.write('\n')
|
configfd.write('\n')
|
||||||
configfd.close()
|
configfd.close()
|
||||||
|
|
||||||
|
###
|
||||||
|
# Set owner user.
|
||||||
|
###
|
||||||
|
owner = anything('What should the owner\'s username be?')
|
||||||
|
password = anything('What should the owner\'s password be?')
|
||||||
|
user = ircdb.IrcUser()
|
||||||
|
user.setPassword(password)
|
||||||
|
user.addCapability('owner')
|
||||||
|
ircdb.users.setUser(owner, user)
|
||||||
|
|
||||||
|
###
|
||||||
|
# Finito!
|
||||||
|
###
|
||||||
print
|
print
|
||||||
print 'You\'re done! Now run the bot with the command line:'
|
print 'You\'re done! Now run the bot with the command line:'
|
||||||
print 'src/bot.py conf/%s.conf' % name
|
print 'src/bot.py conf/%s.conf' % name
|
||||||
|
Loading…
Reference in New Issue
Block a user