MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / grep

Function grep

tests/bash_tests/utils.py:179–185  ·  view source on GitHub ↗
(pattern, *files, encoding=None)

Source from the content-addressed store, hash-verified

177
178
179def grep(pattern, *files, encoding=None):
180 result = ''
181 pattern = '.*{}.*'.format(pattern)
182 for i in files:
183 content = cat(i, encoding=encoding or Config.encoding)
184 result += '\n'.join(re.findall(pattern, content))
185 return result
186
187
188def save(content: (bytes, str, tuple, list), filename, encoding=None):

Callers

nothing calls this directly

Calls 1

catFunction · 0.85

Tested by

no test coverage detected