MCPcopy Create free account
hub / github.com/ActiveState/code / grep

Method grep

recipes/Python/502268_Win_Registry_module/recipe-502268.py:82–90  ·  view source on GitHub ↗
(self, text, kv='both', typ=(rTyp['STR'],))

Source from the content-addressed store, hash-verified

80 for k in key.walk():
81 yield k
82 def grep(self, text, kv='both', typ=(rTyp['STR'],)):
83 # searching keys and/or values for some text
84 for k in self.walk():
85 if kv in ('keys', 'both') and text in k.name:
86 yield k, None
87 if kv in ('vals', 'both'):
88 for v in k.vals:
89 if (v.typ in typ) and (text in v.val):
90 yield k, v
91 def grep2(self, text, kv='both', typ=(rTyp['STR'],)):
92 # a grep variant, might be more convinient in some cases
93 kb=None

Callers 1

recipe-502268.pyFile · 0.80

Calls 1

walkMethod · 0.95

Tested by

no test coverage detected