code: def count_matches(self):
          
  
          try:
              self.fn = self.fo.name
              rows = self.file_rows(self.fo)
              self.fo.seek(0)
  
          except AttributeError:
              with open(self.fn) as fo:
                  rows = self.file_rows(fo)
  
          matches_p = []
          matches_c = []
          for line in rows:
              cnt = len(re.findall(DATPRX, line))
              matches_p.append(cnt)
              cnt = len(re.findall(DATCRX, line))
              matches_c.append(cnt)
  
          self.rows = rows        # Is newlines in the end a problem?
          self.matches_p = matches_p
          self.matches_c = matches_c
docs: Set the matches_p, matches_c and rows attributes.