base.py 431 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
class FileParser:

    def __init__(self, file_path):
        self.file_path = file_path

    def handle_parsing(self, file_handler):
        """
        This method need to be overloaded to really handle the parsing
        """
        for line in file_handler:
            print(line.rstrip())
12
        return None
13
14
15

    def parse(self):
        with open(self.file_path, 'r') as file:
16
            return self.handle_parsing(file)