#!/usr/bin/env python

import sys
import os

def main(latex_file, stdout):
    """
    Texpost Plugin Entry point
    """
    # Let's find out the backend used
    tex_engine = os.environ["LATEX"]

    # Let's log something
    print >>stdout, "Plugin called on '%s' file" % (latex_file)

    # Open the latex file and parse it
    #texfile = open(latex_file)
    #...

    has_changed = False

    # Now decide if a new compilation must occur
    if has_changed:
      sys.exit(0)
    else:
      sys.exit(1)
