本文整理汇总了Python中util.config.Config.fromFile方法的典型用法代码示例。如果您正苦于以下问题:Python Config.fromFile方法的具体用法?Python Config.fromFile怎么用?Python Config.fromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util.config.Config
的用法示例。
在下文中一共展示了Config.fromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: IntegerField
# 需要导入模块: from util.config import Config [as 别名]
# 或者: from util.config.Config import fromFile [as 别名]
class Meta:
db_table = "teaser_users"
# Teaser model fields
id = IntegerField(primary_key=True)
email = CharField(max_length=255, default="")
ip = CharField(max_length=255, default="")
host = CharField(max_length=255, default="")
useragent = CharField(max_length=1024, default="")
notified = IntegerField(default=0)
# Prepare runtime configuration
runtimeConfig = { }
# Load configuration
try:
Config.fromFile( "config/common.conf.local", runtimeConfig )
except ConfigException as e:
print("ERROR Configuration exception: %s" % e)
exit(1)
# Hook CTRL+C
handleSIGINT()
# Ensure we have at least one parameter
if (len(sys.argv) < 2) or (not sys.argv[1]):
print "Pick Teaser Users - Select random users from the teaser list"
print "Usage:"
print ""
print " pick-teaser-users.py <number>"
print ""
exit(1)