X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fc_client.py;h=19c8015a019d63b2f8bffeccb81669e891ce8ab3;hb=ee78071902e93ce22a3170f0937c158fd16894d8;hp=835ae5c929fafa1aea8567fb23a89724574f264e;hpb=b3832bcc46d85110fdb2b553df6249a831cfe0fa;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/c_client.py b/src/c_client.py index 835ae5c..19c8015 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -1,7 +1,8 @@ #!/usr/bin/env python from xml.etree.cElementTree import * -from sys import argv from os.path import basename +import getopt +import sys import re # Jump to the bottom of this file for the main routine @@ -982,6 +983,18 @@ output = {'open' : c_open, # Boilerplate below this point +# Check for the argument that specifies path to the xcbgen python package. +try: + opts, args = getopt.getopt(sys.argv[1:], 'p:') +except getopt.GetoptError, err: + print str(err) + print 'Usage: c_client.py [-p path] file.xml' + sys.exit(1) + +for (opt, arg) in opts: + if opt == '-p': + sys.path.append(arg) + # Import the module class try: from xcbgen.state import Module @@ -996,7 +1009,7 @@ except ImportError: raise # Parse the xml header -module = Module(argv[1], output) +module = Module(args[0], output) # Build type-registry and resolve type dependencies module.register()