本文整理汇总了Python中config.ConfigManager.greeting_probability方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigManager.greeting_probability方法的具体用法?Python ConfigManager.greeting_probability怎么用?Python ConfigManager.greeting_probability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.ConfigManager
的用法示例。
在下文中一共展示了ConfigManager.greeting_probability方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BotFactory
# 需要导入模块: from config import ConfigManager [as 别名]
# 或者: from config.ConfigManager import greeting_probability [as 别名]
help="Bot nickname %s" % config_manager.bot_nick)
parser.add_option("-g", "--greeting", dest="greeting_probability",
action="store",
type="int",
default = 30,
help="Greeting probability [1 - 100]")
parser.add_option("-v", "--verbose", dest="verbose",
action="store_true",
help="Print a lot of stuff...")
options, args = parser.parse_args()
# Set options to ConfigManager
config_manager.server_address = options.server_address
config_manager.server_port = options.port
config_manager.channel = options.channel
config_manager.bot_nick = options.nick
config_manager.verbose = options.verbose
config_manager.greeting_probability = options.greeting_probability
#if not options.<something>:
# parser.error('Must choose one option try -n or -c or --help')
if config_manager.verbose:
print "Information will be stored in ", config_manager.data_path
factory = BotFactory()
factory.connect()
factory.run()