# HG changeset patch # User Tero Marttila # Date 1265303849 -7200 # Node ID 6fd6a9fdc001e3bb0b97a7f577ce884d065f64fd # Parent 92c55179542abc16a41755e922d58576f1f0afd8 add --config, and rename some of the option names/shortnames diff -r 92c55179542a -r 6fd6a9fdc001 fixbot/nexus.py --- a/fixbot/nexus.py Thu Feb 04 19:17:14 2010 +0200 +++ b/fixbot/nexus.py Thu Feb 04 19:17:29 2010 +0200 @@ -46,8 +46,8 @@ config['irc-channel'] ) - log.msg("Connecting to IRC server on [%s:%d]", config['irc-hostname'], config['irc-port']) - irc_client = internet.TCPClient(config['irc-hostname'], config['irc-port'], n.irc) + log.msg("Connecting to IRC server on [%s:%d]", config['irc-server'], config['irc-port']) + irc_client = internet.TCPClient(config['irc-server'], config['irc-port'], n.irc) irc_client.setServiceParent(s) diff -r 92c55179542a -r 6fd6a9fdc001 twisted/plugins/fixbot_nexus_plugin.py --- a/twisted/plugins/fixbot_nexus_plugin.py Thu Feb 04 19:17:14 2010 +0200 +++ b/twisted/plugins/fixbot_nexus_plugin.py Thu Feb 04 19:17:29 2010 +0200 @@ -6,17 +6,16 @@ from twisted.application import internet -from fixbot import nexus +from fixbot import config, nexus -class NexusOptions (usage.Options) : +class NexusOptions (config.ConfigOptions) : + optParameters = [ -# ( "uid", "u", "fixbot", "user to run as" ), -# ( "gid", "g", "nogroup", "group to run as" ), - ( "irc-hostname", "s", "irc.fixme.fi", "IRC server hostname", ), + ( "irc-server", "s", "irc.fixme.fi", "IRC server hostname", ), ( "irc-port", "p", 6667, "IRC server port", int ), - ( "irc-nickname", "n", "FixBotDev", "IRC nickname", ), + ( "irc-nickname", "N", "FixBotDev", "IRC nickname", ), ( "irc-username", "U", "fixbot", "IRC username", ), - ( "irc-channel", "c", "#fixme-test", "IRC channel", ), + ( "irc-channel", "C", "#fixme-test", "IRC channel", ), ( "api-listen", "l", "127.0.0.1", "address for API server to listen on" ), ( "api-port", "P", 34888, "port for API server to listen on", int ), ( "api-secret", None, None, "secret key for API connections" ), @@ -34,7 +33,7 @@ def makeService (self, config) : if config['api-secret'] is None : - raise usage.UsageError("No value given for required option --api-secret") + raise usage.UsageError("No value given for required option api-secret") return nexus.makeService(config)