[ create a new paste ] login | about

Link: http://codepad.org/v9GyLKMq    [ raw code | output | fork ]

Python, pasted on May 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python

import plistlib

def guessType( s ):
	if "one" in s.lower():
		return "GAMEPAD_XBOXONE"
	return "GAMEPAD_XBOX360"

pl = plistlib.readPlist('Info.plist')
hw = pl["IOKitPersonalities"]

for i in hw:
	if hw[i]["IOClass"] == "Xbox360Peripheral":
		print("{ %s,\t0x%04x, 0x%04x, \"%s\" }," % (guessType(i), hw[i]["idVendor"], hw[i]["idProduct"], i))


Output:
1
2
3
4
Traceback (most recent call last):
  Line 3, in <module>
    import plistlib
ImportError: No module named plistlib


Create a new paste based on this one


Comments: