# Path: umap2/apps/vsscan.py
# class DBEntry(object):
#     '''
#     DBEnrty describes a vid, pid.
#     '''
# 
#     def __init__(self, vid, pid, vendor_name='', product_name='', drivers={}, constraints=[], info={}):
#         self.vid = vid
#         self.pid = pid
#         self.vendor_name = vendor_name
#         self.product_name = product_name
#         self.drivers = drivers
#         self.constraints = constraints
#         self.info = info
#         self.os = None
# 
#     def __str__(self):
#         s = 'vid:pid %04x:%04x' % (self.vid, self.pid)
#         if self.vendor_name:
#             s += ', vendor: %s' % self.vendor_name
#         if self.product_name:
#             s += ', product: %s' % self.product_name
#         if self.drivers:
#             if self.os and self.os in self.drivers:
#                 s += ', driver: %s' % self.drivers[self.os]
#             else:
#                 s += ', drivers: %s' % self.drivers
#         if self.constraints:
#             s += ', constraints: %s' % self.constraints
#         if self.info:
#             s += ', info: %s' % self.info
#         return s
# 
#     def vidpid(self):
#         return '%04x:%04x' % (self.vid, self.pid)
# 
# class OS(object):
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     OSX = 'OSX'
#     QNX = 'QNX'


from umap2.apps.vsscan import DBEntry, OS
import sys
    DBEntry(0x04b4, 0x931c, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931d, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931e, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931f, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x9320, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x9321, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9001, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9002, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9006, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9008, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x931c, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x932c, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x245f, 0x931c, '', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x25c6, 0x9002, '', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
###### QNX 660 ###### (from: /etc/usblauncher/rules.lua)
    DBEntry(0x1234, 0xfff1, '', '', drivers={OS.QNX: 'mm-ipod'}),
    DBEntry(0x1234, 0x0004, '', '', drivers={OS.QNX: 'devc-serusb_dcd'}),
    DBEntry(0x0781, 0x5567, 'SanDisk', 'Cruzer Blade', drivers={OS.QNX: 'devb-umass'}),
    DBEntry(0x5dc, 0xa410, '', '', drivers={OS.QNX: ''}),
    DBEntry(0x05AC, 0x1200, 'Apple, Inc.', 'ipod', drivers={OS.QNX: 'io-audio'}),
    DBEntry(0x054c, 0x03fd, 'Sony Corp.', 'Walkman', drivers={OS.QNX: 'io-fs-media'}),
]


if __name__ == '__main__':
    history = set()
    for db_entry in db:
        if (db_entry.vid, db_entry.pid) in history:
            print 'Duplicate found: 0x%04x, 0x%04x' % (db_entry.vid, db_entry.pid)
            sys.exit(1)

# Path: umap2/apps/vsscan.py
# class DBEntry(object):
#     '''
#     DBEnrty describes a vid, pid.
#     '''
# 
#     def __init__(self, vid, pid, vendor_name='', product_name='', drivers={}, constraints=[], info={}):
#         self.vid = vid
#         self.pid = pid
#         self.vendor_name = vendor_name
#         self.product_name = product_name
#         self.drivers = drivers
#         self.constraints = constraints
#         self.info = info
#         self.os = None
# 
#     def __str__(self):
#         s = 'vid:pid %04x:%04x' % (self.vid, self.pid)
#         if self.vendor_name:
#             s += ', vendor: %s' % self.vendor_name
#         if self.product_name:
#             s += ', product: %s' % self.product_name
#         if self.drivers:
#             if self.os and self.os in self.drivers:
#                 s += ', driver: %s' % self.drivers[self.os]
#             else:
#                 s += ', drivers: %s' % self.drivers
#         if self.constraints:
#             s += ', constraints: %s' % self.constraints
#         if self.info:
#             s += ', info: %s' % self.info
#         return s
# 
#     def vidpid(self):
#         return '%04x:%04x' % (self.vid, self.pid)
# 
# class OS(object):
#     LINUX = 'Linux'
#     WINDOWS = 'Windows'
#     OSX = 'OSX'
#     QNX = 'QNX'


# Path: data/vid_pid_db.py
from umap2.apps.vsscan import DBEntry, OS
import sys

    DBEntry(0x04b4, 0x931c, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931d, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931e, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x931f, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x9320, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x04b4, 0x9321, 'Cypress Semiconductor Corp.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9001, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9002, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9006, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x9008, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x931c, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x249c, 0x932c, 'M2Tech s.r.l.', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x245f, 0x931c, '', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
    DBEntry(0x25c6, 0x9002, '', '', drivers={OS.LINUX: 'sound/usb/hiface/chip.c'}),
###### QNX 660 ###### (from: /etc/usblauncher/rules.lua)
    DBEntry(0x1234, 0xfff1, '', '', drivers={OS.QNX: 'mm-ipod'}),
    DBEntry(0x1234, 0x0004, '', '', drivers={OS.QNX: 'devc-serusb_dcd'}),
    DBEntry(0x0781, 0x5567, 'SanDisk', 'Cruzer Blade', drivers={OS.QNX: 'devb-umass'}),
    DBEntry(0x5dc, 0xa410, '', '', drivers={OS.QNX: ''}),
    DBEntry(0x05AC, 0x1200, 'Apple, Inc.', 'ipod', drivers={OS.QNX: 'io-audio'}),
    DBEntry(0x054c, 0x03fd, 'Sony Corp.', 'Walkman', drivers={OS.QNX: 'io-fs-media'}),
]


if __name__ == '__main__':
    history = set()
    for db_entry in db:
        if (db_entry.vid, db_entry.pid) in history:
            print 'Duplicate found: 0x%04x, 0x%04x' % (db_entry.vid, db_entry.pid)
            sys.exit(1)

        else: