code: def process_dir(self, dirname):
          
          ret = []
          sub_rec = [f for f in os.listdir(dirname)]
          for fname in sub_rec:
              full_path = os.path.join(dirname, fname)
  
              if os.path.isfile(full_path):
                  with open(full_path, 'rb') as fh:
                      sub = self.process_file(fh.read(), fname)
                      ret.append(sub)
  
              elif os.path.isdir(full_path):
                  sub = self.process_dir(full_path)
                  ret.append(sub)
          return ret
docs: Directory processing
          :param dirname:
          :return: