def selectcontents(**boolean):
'''Fetch all of the functions containing the specified tags within it's contents'''
boolean = dict((k,__builtin__.set(v if isinstance(v, (__builtin__.tuple,__builtin__.set,__builtin__.list)) else (v,))) for k,v in boolean.viewitems())
if not boolean:
for ea,_ in internal.comment.contents.iterate():
res = internal.comment.contents.name(ea)
if res: yield ea, res
return
for ea, res in internal.comment.contents.iterate():
# check to see that the dict's keys match
res,d = __builtin__.set(res),internal.comment.contents._read(None, ea)
if __builtin__.set(d.viewkeys()) != res:
# FIXME: include query in warning
logging.warn("{:s}.selectcontents : Contents cache is out of sync. Using contents blob instead of supval. : {:x}".format(__name__, ea))
# now start aggregating the keys that the user is looking for
res, d = __builtin__.set(), internal.comment.contents.name(ea)
Or = boolean.get('Or', __builtin__.set())
res.update(Or.intersection(d))
And = boolean.get('And', __builtin__.set())
if And:
if And.intersection(d) == And:
res.update(And)
else: continue
if res: yield ea,res
return
评论列表
文章目录