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


Python Store.getstore方法代码示例

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


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

示例1: post_db_init

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import getstore [as 别名]
 def post_db_init(self):
     '''Create IS_A relationship to our 'class' node in the database, and set creation time'''
     if not self._baseinitfinished:
         self._baseinitfinished = True
         if Store.is_abstract(self) and self.nodetype != CMAconsts.NODE_nodetype:
             store = Store.getstore(self)
             if self.nodetype not in GraphNode.classtypeobjs:
                 GraphNode.initclasstypeobj(store, self.nodetype)
             store.relate(self, CMAconsts.REL_isa, GraphNode.classtypeobjs[self.nodetype])
             assert GraphNode.classtypeobjs[self.nodetype].name == self.nodetype
             self.time_create_ms = int(round(time.time()*1000))
             self.time_create_iso8601  = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime())
开发者ID:borgified,项目名称:testroot,代码行数:14,代码来源:graphnodes.py

示例2: childfactory

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import getstore [as 别名]
 def childfactory(parentsystem, childtype, designation, jsonobj, roles=None, domain=None):
     'We construct an appropriate ChildSystem subclass object - or find it in the database'
     store = Store.getstore(parentsystem)
     if childtype == 'docker':
         cls = DockerSystem
     elif childtype == 'vagrant':
         cls = VagrantSystem
     else:
         raise ValueError('Unknown ChildSystem type(%s)' % childtype)
     uniqueid = ChildSystem.compute_uniqueid(designation, parentsystem, domain)
     return store.load_or_create(cls, designation=designation, _selfjson=str(jsonobj),
                                 _parentsystem=parentsystem, roles=roles, uniqueid=uniqueid)
开发者ID:JJediny,项目名称:assimilation-official,代码行数:14,代码来源:systemnode.py

示例3: find_child_system_from_json

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import getstore [as 别名]
 def find_child_system_from_json(self, jsonobj):
     '''Locate the child drone that goes with this JSON - or maybe it's us'''
     if 'proxy' in jsonobj:
         path = jsonobj['proxy']
         if path == 'local/local':
             return self
     else:
         return self
     # This works - could be a bit slow if you have lots of child nodes...
     q = '''MATCH (drone)<-[:parentsys*]-(child)
            WHERE ID(drone) = {id} AND child.childpath = {path}
            RETURN child'''
     store = Store.getstore(self)
     child = store.load_cypher_node(q, GraphNode.factory, {'id': store.id(self), 'path': path})
     if child is None:
         raise(ValueError('Child system %s from %s [%s] was not found.'
             %       (path, str(self), str(Store.id(self)))))
     return child
开发者ID:JJediny,项目名称:assimilation-official,代码行数:20,代码来源:droneinfo.py


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