9
line_pattern = r"\s*(\d+)\s+dev='([^']+)'" \
10
"\s+([wr-]{6})\s:\s'([^']+)'\s'([^']+)'"
11
line_regex = re.compile(line_pattern)
14
command = "wodim --devices"
15
for line in os.popen(command).readlines():
16
match = re.match(line_regex, line)
19
print match.group(4), match.group(5)
28
if __name__ == "__main__":
29
sys.exit(main(sys.argv[1:]))