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


Python Store.lucene_escape方法代码示例

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


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

示例1: find

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import lucene_escape [as 别名]
 def find(name, domain=None):
     "Iterate through a series of MonitorAction nodes matching the criteria"
     if MonitorAction.findquery is None:
         cypher = "START m=node:MonitorAction({q}) RETURN m"
         MonitorAction.findquery = neo4j.CypherQuery(CMAdb.store.db, cypher)
     name = Store.lucene_escape(name)
     qvalue = "%s:%s" % (name, "*" if domain is None else domain)
     return CMAdb.store.load_cypher_nodes(MonitorAction.findquery, MonitorAction, params={"q": qvalue})
开发者ID:borgified,项目名称:testroot,代码行数:10,代码来源:monitoring.py

示例2: find

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import lucene_escape [as 别名]
 def find(name, domain=None):
     'Iterate through a series of MonitorAction nodes matching the criteria'
     if MonitorAction.findquery is None:
         MonitorAction.findquery = 'START m=node:MonitorAction({q}) RETURN m'
     name = Store.lucene_escape(name)
     qvalue = '%s:%s' % (name, '*' if domain is None else domain)
     return CMAdb.store.load_cypher_nodes(MonitorAction.findquery, MonitorAction
     ,   params={'q': qvalue})
开发者ID:Alan-R,项目名称:assimilation-persistent-events,代码行数:10,代码来源:monitoring.py

示例3: find

# 需要导入模块: from store import Store [as 别名]
# 或者: from store.Store import lucene_escape [as 别名]
    def find(designation, port=None, domain=None):
        'Find a drone with the given designation or IP address, or Neo4J node.'
        desigstr = str(designation)
        if isinstance(designation, Drone):
            designation.set_crypto_identity()
            return designation
        elif isinstance(designation, str):
            if domain is None:
                domain = CMAconsts.globaldomain
            designation = designation.lower()
            drone = CMAdb.store.load_or_create(Drone, port=port, domain=domain
            ,       designation=designation)
            assert drone.designation == designation
            assert CMAdb.store.has_node(drone)
            drone.set_crypto_identity()
            return drone
        elif isinstance(designation, pyNetAddr):
            desig = designation.toIPv6()
            desig.setport(0)
            desigstr = str(desig)
            if domain is None:
                dstr = '*'
            else:
                dstr = domain
            query = '%s:%s' % (str(Store.lucene_escape(desigstr)), dstr)
            #We now do everything by IPv6 addresses...
            drone = CMAdb.store.load_cypher_node(Drone.IPownerquery_1, Drone, {'ipaddr':query})
            if drone is not None:
                assert CMAdb.store.has_node(drone)
                drone.set_crypto_identity()
                return drone
            if CMAdb.debug:
                CMAdb.log.warn('Could not find IP NetAddr address in Drone.find... %s [%s] [%s]'
                %   (designation, desigstr, type(designation)))

        if CMAdb.debug:
            CMAdb.log.debug("DESIGNATION2 (%s) = %s" % (designation, desigstr))
            CMAdb.log.debug("QUERY (%s) = %s" % (designation, query))
            print >> sys.stderr, ("DESIGNATION2 (%s) = %s" % (designation, desigstr))
            print >> sys.stderr, ("QUERY (%s) = %s" % (designation, query))
        if CMAdb.debug:
            raise RuntimeError('drone.find(%s) (%s) (%s) => returning None' % (
                str(designation), desigstr, type(designation)))
                #str(designation), desigstr, type(designation)))
            #tblist = traceback.extract_stack()
            ##tblist = traceback.extract_tb(trace, 20)
            #CMAdb.log.info('======== Begin missing IP Traceback ========')
            #for tbelem in tblist:
                #(filename, line, funcname, text) = tbelem
                #filename = os.path.basename(filename)
                #CMAdb.log.info('%s.%s:%s: %s'% (filename, line, funcname, text))
            #CMAdb.log.info('======== End missing IP Traceback ========')
            #CMAdb.log.warn('drone.find(%s) (%s) (%s) => returning None' % (
        return None
开发者ID:h4ck3rm1k3,项目名称:assimilation-official,代码行数:56,代码来源:droneinfo.py


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