MCPcopy Index your code
hub / github.com/ndleah/python-mini-project / readFile

Function readFile

Cat_command/cat.py:26–40  ·  view source on GitHub ↗

if the given path is a directory ERROR the path is a directory

(src: Path)

Source from the content-addressed store, hash-verified

24 your/path/file.txt
25'''
26def readFile(src: Path):
27
28 '''
29 if the given path is a directory
30 ERROR the path is a directory
31 '''
32 if src.is_dir():
33
34 logger.error(f'The path {src}: is a directory')
35
36 else:
37
38 with open(src, 'r') as f:
39 for lines in f:
40 print(lines, end='')
41
42def cli() -> argparse.Namespace:
43 parser = argparse.ArgumentParser(

Callers 1

mainFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected