コード例 #1
0
    def _main(self):
        """
        get's automatically called from Memacs class
        read the lines from svn xml file, parse and write them to org file
        """

        # read file
        if self._args.svnlogxmlfile:
            logging.debug("using as %s input_stream", self._args.svnlogxmlfile)
            data = CommonReader.get_data_from_file(self._args.svnlogxmlfile)
        else:
            logging.info("Using stdin as input_stream")
            data = CommonReader.get_data_from_stdin()

        try:
            xml.sax.parseString(
                data.encode('utf-8'),
                SvnSaxHandler(self._writer, self._args.grepauthor))
        except SAXParseException:
            logging.error("No correct XML given")
            sys.exit(1)