-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.py
More file actions
33 lines (26 loc) · 761 Bytes
/
Copy pathparser.py
File metadata and controls
33 lines (26 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import cProfile
import argparse
from boardhelper import BoardHelper
parser = argparse.ArgumentParser(description='Fill the biggest square in the board with the given fill char', )
parser.add_argument(
'filesnames',
help='Files names that should be processed',
nargs='*')
parser.add_argument(
'-p',
'--run_profiler',
help='Run profiler',
action='store_true')
args = parser.parse_args()
def process_files():
for file_name in args.filesnames:
try:
try_helper = BoardHelper(file_name)
print(try_helper.fill_biggest_square())
print("\n")
except Exception as err:
print(f"{err}")
if args.run_profiler:
cProfile.run('process_files()')
else:
process_files()