Пример #1
0
    def run(self):
        logging.info('Started.')

        for rel_path in os.listdir(self.match_dir):
            abs_path = os.path.join(self.match_dir, rel_path)
            if not os.path.isfile(abs_path):
                continue

            logging.info('Processing {}'.format(rel_path))
            self._process_match_file(abs_path)

        Util.write_file('output.txt', '{}'.format(os.linesep).join([output.xml for output in self.output_list]))

        logging.info('Ended.')
Пример #2
0
 def _command_capture_text(self):
     try:
         Util.write_file(self.CAPTURE_PATH, os.linesep.join(self._last_text))
         print('* Capture successful - {}.{}'.format(self.CAPTURE_PATH, os.linesep))
     except IOError as e:
         print('* {}{}'.format(e.message, os.linesep))
Пример #3
0
 def _command_save_file(self, path):
     try:
         Util.write_file(path, os.linesep.join(self._updated_text))
         print('* Save successful.{}'.format(os.linesep))
     except IOError as e:
         print('* {}{}'.format(e.message, os.linesep))