本文整理汇总了Python中ConfigParser.ConfigParser.location方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigParser.location方法的具体用法?Python ConfigParser.location怎么用?Python ConfigParser.location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigParser.ConfigParser
的用法示例。
在下文中一共展示了ConfigParser.location方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ConfigParser import ConfigParser [as 别名]
# 或者: from ConfigParser.ConfigParser import location [as 别名]
def __init__(self, hwios_config):
service_reference = self.find_services()
for service in service_reference:
_temp = __import__(service['module'], globals(), locals(), [service['class']], -1)
service_config = ConfigParser()
service_config.read('./services/%s/service.ini' % service['dir'])
service_config.location = '%s/services/%s/' % (os.getcwd(),service['dir'])
HWIOS.services[service['dir']] = getattr(_temp,service['class'])(service_config,hwios_config)
twisted_server = HWIOS.services[service['dir']].get_service()
twisted_server.setServiceParent(HWIOS.service_collection)
示例2: __init__
# 需要导入模块: from ConfigParser import ConfigParser [as 别名]
# 或者: from ConfigParser.ConfigParser import location [as 别名]
def __init__(self, hwios_config):
service_reference = self.find_services()
for service in service_reference:
_temp = __import__(service['module'], globals(), locals(), [service['class']], -1)
service_config = ConfigParser()
service_config.location = os.path.join(HWIOS_ROOT,'services',service['dir'])
service_config.read(os.path.join(service_config.location,'service.ini'))
HWIOS.services[service['dir']] = getattr(_temp,service['class'])(service_config,hwios_config)
twisted_server = HWIOS.services[service['dir']].get_service()
twisted_server.setServiceParent(HWIOS.service_collection)