1 import os
2 import subprocess
3 import shlex
4
5
6
7
8
9
10
11
12
13
14
15
16 -def filterRIB( in_RIB_file, out_RIB_file, argsStr ):
17
18 catRibPath = os.environ['RMANTREE'] + '/bin/catrib'
19 args = [ catRibPath ]
20 args.extend( shlex.split(argsStr) )
21 args.append( "-o" )
22 args.append( out_RIB_file)
23 args.append( in_RIB_file)
24
25 process = subprocess.Popen( args, shell=False, stdout=subprocess.PIPE)
26 output = process.communicate()
27
28 if process.returncode != 0:
29 raise Exception( "Error running RIB filter (" + str(process.returncode) + ")" )
30