1 # Copyright 2000 Enhanced Software Technologies Inc.
3 # Released under Free Software Foundation's General Public License,
6 # Routine to call 'tapeinfo' and read status for a node. This is an
7 # example of how to parse the 'tapeinfo' output from a scripting language.
15 configdir="/opt/brupro/bin" # sigh.
20 # okay, now do the thing:
22 command="%s/tapeinfo -f %s" % (configdir,device)
26 infile=os.popen(command,"r")
34 return None # did not get anything.
37 idx,val=string.split(s,':',1)
40 val=val[1:-1] # strip off single quotes, sigh.
45 val=string.replace(val,"\0","")
53 continue # to top of loop!