#! /usr/bin/env python2
#
#  Copyright (C) 2000-2004 CEA
#
#  This software and supporting documentation were developed by
#  	CEA/DSV/SHFJ
#  	4 place du General Leclerc
#  	91401 Orsay cedex
#  	France
#
import sys, os.path, getopt 

def usage():
    str="""NAME
    %s - A table editor tool
SYNOPSIS
    %s [ options ] file.dat
OPTIONS
    -h, --help               print help information and exit.
    """%(os.path.basename(sys.argv[0]),os.path.basename(sys.argv[0]))
    print str
def complet_sys_path():
    mainPath = os.path.abspath(os.path.join(sys.path[0],'..'))
    try:
        sys.path.index(mainPath)
    except ValueError:
        sys.path.append(mainPath)
    try:
        sys.path.index(os.path.join(mainPath,'lib'))
    except ValueError:
        sys.path.append(os.path.join(mainPath,'lib'))
    return mainPath

if __name__=="__main__":
    complet_sys_path()
    try:
        opts, args = getopt.getopt( sys.argv[ 1: ], 'h',
                                    [ 'help'] )
    except getopt.GetoptError:
        # print help information and exit:
        usage()
        sys.exit( 2 )
        
    for o, a in opts:
        if o in ( '-h', '--help' ):
            usage()
            sys.exit()

    import genericTableEditor
    genericTableEditor.mainTableEditor(sys.argv)
    
