#! /usr/bin/python

import gobject, gtk
import getopt,sys,os

from pylocator import run_pylocator

usage="""usage: %s [options]
options:
--help -h         print this message
--filename -f     filename""" % sys.argv[0]

def main(*args):
    try:
        options, args = getopt.getopt(sys.argv[1:], 'hf:s:', ['help','filename=','surface'])
    except (getopt.GetoptError):
            print usage; sys.exit(0)

    filename=None
    surface=None
    for option, value in options:
        if option in ('-h', '--help'):
            print usage; sys.exit(0)
        if option in ('-f', '--file'):
            filename=value
        if option in ('-s', '--surface'):
            surface=value

    run_pylocator(filename=filename,surface=surface)

if __name__=="__main__":
    main()
