def get_scripts_path():
+ if options.apitrace_source:
+ return os.path.join(options.apitrace_source, 'scripts')
+
bin_path = get_bin_path()
try_paths = [
sys.exit(1)
-class Main:
- global options
+class Driver:
+
+ def __init__(self):
+ pass
def createOptParser(self):
default_apitrace = 'apitrace'
'--apitrace', metavar='PROGRAM',
type='string', dest='apitrace', default=default_apitrace,
help='path to apitrace executable')
+ optparser.add_option(
+ '--apitrace-source', metavar='PATH',
+ type='string', dest='apitrace_source',
+ help='path to apitrace source tree')
optparser.add_option(
'-C', '--directory', metavar='PATH',
type='string', dest='cwd', default=None,
if not args:
optparser.error('an argument must be specified')
- print get_scripts_path()
-
sys.path.insert(0, get_scripts_path())
+ self.options = options
+ self.args = args
+
return options, args
- def main(self):
+ def run(self):
raise NotImplementedError