MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _read_file

Function _read_file

pager_lib/getmac/getmac.py:228–236  ·  view source on GitHub ↗
(filepath)

Source from the content-addressed store, hash-verified

226
227
228def _read_file(filepath):
229 # type: (str) -> Optional[str]
230 try:
231 with open(filepath) as f:
232 return f.read()
233 # This is IOError on Python 2.7
234 except (OSError, IOError): # noqa: B014
235 log.debug("Could not find file: '%s'", filepath)
236 return None
237
238
239def _search(regex, text, group_index=0, flags=0):

Callers 3

getMethod · 0.85
getMethod · 0.85
getMethod · 0.85

Calls 2

debugMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected