Blob Blame Raw
#!/usr/bin/python

import csv
import sys

csvfile = open(sys.argv[1])
dialect = csv.Sniffer().sniff(csvfile.read(1024))
csvfile.seek(0)

reader = csv.reader(csvfile, dialect)

# pciid, define, family, mobility, igp, nocrtc2, Nointtvout, singledac, name
for line in reader:
    if line[0].find("pciid") is not -1:
	continue
    if line[2].find("MACH") is not -1 or line[2].find("R128") is not -1:
	continue
    print "alias pcivideo:v00001002d0000%ssv*sd*bc*sc*i* radeon # %s" % \
	    (line[0].split('x')[1], line[8])