当前位置: 首页>>代码示例>>Python>>正文


Python ConfigCache.load方法代码示例

本文整理汇总了Python中WMCore.Cache.WMConfigCache.ConfigCache.load方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigCache.load方法的具体用法?Python ConfigCache.load怎么用?Python ConfigCache.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMCore.Cache.WMConfigCache.ConfigCache的用法示例。


在下文中一共展示了ConfigCache.load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testC_testViews

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import load [as 别名]
    def testC_testViews(self):
        """
        _testViews_

        Prototype test for what should be a lot of other tests.
        """
        PSetTweak = "Hello, I am a PSetTweak.  It's nice to meet you."
        attach    = "Hello, I am an attachment"

        configCache = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
        configCache.createUserGroup(groupname = "testGroup", username = 'testOps')
        configCache.setPSetTweaks(PSetTweak = PSetTweak)
        configCache.attachments['attach1'] = attach
        configCache.document['md5_hash'] = "somemd5"
        psetPath = os.path.join(getTestBase(), "WMCore_t/Cache_t/PSet.txt")        
        configCache.addConfig(newConfig = psetPath, psetHash = None)        
        configCache.save()
        
        configCache2 = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
        configCache2.document['md5_hash'] = configCache.document['md5_hash']
        configCache2.load()
        
        self.assertEqual(configCache2.attachments.get('attach1', None), attach)
        configCache2.delete()
        return
开发者ID:stuartw,项目名称:WMCore,代码行数:27,代码来源:WMConfigCache_t.py

示例2: __init__

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import load [as 别名]
    def __init__(self, **options):
        GeneratorInterface.__init__(self, **options)
        self.couchUrl = options.get("CouchUrl")
        self.couchDBName = options.get("CouchDBName")
        self.couchConfigDoc = options.get("ConfigCacheDoc")

        confCache = ConfigCache(dbURL = self.couchUrl, couchDBName = self.couchDBName, id = self.couchConfigDoc)
        confCache.load()
        seeds = confCache.document[u'pset_tweak_details'][u'process'][u'RandomNumberGeneratorService']
        self.seedTable = []
        for k in seeds.keys():
            if k == u"parameters_" : continue
            self.seedTable.append("process.RandomNumberGeneratorService.%s.initialSeed" % k)
开发者ID:AndresTanasijczuk,项目名称:WMCore,代码行数:15,代码来源:ReproducibleSeeding.py

示例3: testD_LoadConfigCache

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import load [as 别名]
    def testD_LoadConfigCache(self):
        """
        _LoadConfigCache_

        Actually load the config cache using plain .load()
        Tests to make sure that if we pass in an id field it gets used to load configs
        """

        configCache = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
        configCache.createUserGroup(groupname = "testGroup", username = 'testOps')
        configCache.setLabel("labelA")
        configCache.save()

        configCache2 = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test',
                                   id = configCache.getCouchID(),
                                   rev = configCache.getCouchRev())
        configCache2.load()
        self.assertEqual(configCache2.document['owner'],
                         {'group': 'testGroup', 'user': 'testOps'})
        self.assertEqual(configCache2.document['description'],
                         {'config_desc': None, 'config_label': 'labelA'})
        return
开发者ID:stuartw,项目名称:WMCore,代码行数:24,代码来源:WMConfigCache_t.py


注:本文中的WMCore.Cache.WMConfigCache.ConfigCache.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。