def listOptions(printer):
	lpop = subprocess.Popen(['lpoptions','-p',printer,'-l'],stdout=subprocess.PIPE)
	lpout = lpop.communicate()[0].split('\n')[:-1]
	ops = []
	
	for line in lpout:
		name, values = line.split(':')
		human_name = name[name.index('/')+1:]
		name = name[:name.index('/')]
		valuelist = values.split(' ')
		for i,v in enumerate(valuelist):
			if '*' in v:
				valuelist[i] = valuelist[i].replace('*','')
				
		ops.append(Option(name,valuelist,None,human_name))
	
	return ops
dataset/ETHPy150Open Narcolapser/python-o365/examples/EmailPrinting/printing.py/listOptions/original