Example #1
0
            if sync_command:
                viewer_status = call(sync_command, shell=True)
            else:
                print("The viewer {} does not support pdfsync".format(viewer))
                exit(EXIT_SHOW_TOOL_TIP)

        else:
            print("Either you need to include `pdfsync.sty` in your document" +
                  "or you need to use an engine that supports pdfsync.")
            exit(EXIT_SHOW_TOOL_TIP)

    elif command == 'chktex':
        command = "{} '{}'".format(command, filename)
        process = Popen(command, shell=True, stdout=PIPE, stdin=PIPE,
                        stderr=STDOUT, close_fds=True, universal_newlines=True)
        parser = ChkTexParser(process.stdout, verbose, filename)
        fatal_error, number_errors, number_warnings = parser.parse_stream()
        tex_status = process.wait()

    # Check status of running the viewer
    if viewer_status != 0:
        print('<p class="error"><strong>Error {} '.format(viewer_status) +
              'opening viewer</strong></p>')

    if tex_status > 0:
        print('<p class="warning"> Command {} '.format(command) +
              'exited with status {}'.format(tex_status))
    elif tex_status < 0:
        print('<p class="error"> Command {} exited '.format(command) +
              'with error code {}</p>'.format(tex_status))
Example #2
0
        else:
            print("Either you need to include `pdfsync.sty` in your document" +
                  "or you need to use an engine that supports pdfsync.")
            exit(EXIT_SHOW_TOOL_TIP)

    elif command == 'chktex':
        command = "{} '{}'".format(command, filename)
        process = Popen(command,
                        shell=True,
                        stdout=PIPE,
                        stdin=PIPE,
                        stderr=STDOUT,
                        close_fds=True,
                        universal_newlines=True)
        parser = ChkTexParser(process.stdout, verbose, filename)
        fatal_error, number_errors, number_warnings = parser.parse_stream()
        tex_status = process.wait()

    # Check status of running the viewer
    if viewer_status != 0:
        print('<p class="error"><strong>Error {} '.format(viewer_status) +
              'opening viewer</strong></p>')

    if tex_status > 0:
        print('<p class="warning"> Command {} '.format(command) +
              'exited with status {}'.format(tex_status))
    elif tex_status < 0:
        print('<p class="error"> Command {} exited '.format(command) +
              'with error code {}</p>'.format(tex_status))