From 7dbd7dc987eb70a663c9e26f8f6a5de3671c08a1 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 5 May 2011 13:29:20 +0000 Subject: h-client:added device icons and classes --- h-client/credits.txt | 20 ++++++ h-client/hlibrary.py | 83 +++++++++++++++++++++- h-client/img/devices/big/3G-card.png | Bin 0 -> 2789 bytes h-client/img/devices/big/acquisition-card.png | Bin 0 -> 4273 bytes h-client/img/devices/big/bluetooth.png | Bin 0 -> 3027 bytes h-client/img/devices/big/fingerprint-reader.png | Bin 0 -> 4669 bytes h-client/img/devices/big/scanner.png | Bin 0 -> 2327 bytes h-client/img/devices/big/webcam.png | Bin 0 -> 3441 bytes h-client/img/devices/small/3G-card.png | Bin 0 -> 1123 bytes h-client/img/devices/small/acquisition-card.png | Bin 0 -> 4075 bytes h-client/img/devices/small/bluetooth.png | Bin 0 -> 1046 bytes h-client/img/devices/small/fingerprint-reader.png | Bin 0 -> 1314 bytes h-client/img/devices/small/scanner.png | Bin 0 -> 856 bytes h-client/img/devices/small/webcam.png | Bin 0 -> 1236 bytes 14 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 h-client/img/devices/big/3G-card.png create mode 100755 h-client/img/devices/big/acquisition-card.png create mode 100755 h-client/img/devices/big/bluetooth.png create mode 100644 h-client/img/devices/big/fingerprint-reader.png create mode 100755 h-client/img/devices/big/scanner.png create mode 100755 h-client/img/devices/big/webcam.png create mode 100755 h-client/img/devices/small/3G-card.png create mode 100755 h-client/img/devices/small/acquisition-card.png create mode 100755 h-client/img/devices/small/bluetooth.png create mode 100644 h-client/img/devices/small/fingerprint-reader.png create mode 100755 h-client/img/devices/small/scanner.png create mode 100755 h-client/img/devices/small/webcam.png (limited to 'h-client') diff --git a/h-client/credits.txt b/h-client/credits.txt index c272430..53d35a4 100644 --- a/h-client/credits.txt +++ b/h-client/credits.txt @@ -6,17 +6,37 @@ img/devices/small/unknown.png img/devices/small/soundcard.png img/devices/small/wifi.png img/devices/small/printer.png +img/devices/small/scanner.png +img/devices/small/webcam.png +img/devices/small/bluetooth.png img/devices/big/unknown.png img/devices/big/soundcard.png img/devices/big/wifi.png img/devices/big/printer.png +img/devices/big/scanner.png +img/devices/big/webcam.png +img/devices/big/bluetooth.png icons taken from the Crystal Projects icons (http://www.everaldo.com/crystal/?action=downloads), licensed under the LGPL license img/devices/small/videocard.png +img/devices/small/3G-card.png +img/devices/small/acquisition-card.png.png img/devices/big/videocard.png +img/devices/big/3G-card.png +img/devices/big/acquisition-card.png.png + + + +Fingerprint icons: + +The fingerprint icons (listed below) are a derived work from a wikipedia fingerprint icon (http://en.wikipedia.org/wiki/File:Fingerprint_picture.svg) licensed under Creative Commons Attribution-Share Alike 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/deed.en) +img/devices/small/fingerprint-reader.png +img/devices/big/fingerprint-reader.png + + Libraries: diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py index 389eff3..7f9d900 100644 --- a/h-client/hlibrary.py +++ b/h-client/hlibrary.py @@ -314,6 +314,85 @@ class Printer(Device): self._post['compatibility'] = self._howItWorks self._post['subtype'] = self._subtype +class Scanner(Device): + + def __init__(self): + super(Scanner, self).__init__() + self._type = 'scanner' + self._howItWorks = 'C-None' + self._interfaces = ['not-specified','USB','Serial','Parallel','Firewire','SCSI','Ethernet'] + self._howItWorksOptions = ['A-Full','B-Partial','C-None'] + self._icon = 'scanner.png' + + def setPost(self): + super(Scanner, self).setPost() + self._post['compatibility'] = self._howItWorks + +class Threegcard(Device): + + def __init__(self): + super(Threegcard, self).__init__() + self._type = '3G-card' + self._howItWorks = 'no' + self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card'] + self._icon = '3G-card.png' + + def setPost(self): + super(Threegcard, self).setPost() + self._post['wifi_works'] = self._howItWorks + +class Webcam(Device): + + def __init__(self): + super(Webcam, self).__init__() + self._type = 'webcam' + self._howItWorks = 'no' + self._interfaces = ['not-specified','USB','Firewire','Parallel','Wifi','Serial'] + self._icon = 'webcam.png' + + def setPost(self): + super(Webcam, self).setPost() + self._post['webcam_works'] = self._howItWorks + +class Bluetooth(Device): + + def __init__(self): + super(Bluetooth, self).__init__() + self._type = 'bluetooth' + self._howItWorks = 'no' + self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card'] + self._icon = 'bluetooth.png' + + def setPost(self): + super(Bluetooth, self).setPost() + self._post['bluetooth_works'] = self._howItWorks + +class Acquisitioncard(Device): + + def __init__(self): + super(Acquisitioncard, self).__init__() + self._type = 'acquisition-card' + self._howItWorks = 'no' + self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card','Firewire','Parallel','Serial'] + self._icon = 'acquisition-card.png' + + def setPost(self): + super(Acquisitioncard, self).setPost() + self._post['compatibility'] = self._howItWorks + +class Fingerprintreader(Device): + + def __init__(self): + super(Fingerprintreader, self).__init__() + self._type = 'fingerprint-reader' + self._howItWorks = 'no' + self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card','Firewire','Parallel','Serial'] + self._icon = 'fingerprint-reader.png' + + def setPost(self): + super(Fingerprintreader, self).setPost() + self._post['fingerprint_works'] = self._howItWorks + class Unknown(Device): def __init__(self): @@ -755,12 +834,14 @@ class Client: if code.hasChildNodes(): if (code.childNodes[0].data == vendorid_productid): + + modelName = device.getElementsByTagName("model_name")[0].childNodes[0].data.encode('utf-8') interface = device.getElementsByTagName("interface")[0].childNodes[0].data.encode('utf-8') distribution = device.getElementsByTagName("distribution")[0].childNodes[0].data.encode('utf-8') idDevice = device.getElementsByTagName("id")[0].childNodes[0].data.encode('utf-8') - if deviceType == 'printer': + if deviceType == 'printer' or deviceType == 'scanner': works = device.getElementsByTagName("compatibility")[0].childNodes[0].data.encode('utf-8') #set the subtype diff --git a/h-client/img/devices/big/3G-card.png b/h-client/img/devices/big/3G-card.png new file mode 100755 index 0000000..4ae2ba5 Binary files /dev/null and b/h-client/img/devices/big/3G-card.png differ diff --git a/h-client/img/devices/big/acquisition-card.png b/h-client/img/devices/big/acquisition-card.png new file mode 100755 index 0000000..d39e18a Binary files /dev/null and b/h-client/img/devices/big/acquisition-card.png differ diff --git a/h-client/img/devices/big/bluetooth.png b/h-client/img/devices/big/bluetooth.png new file mode 100755 index 0000000..8f755b9 Binary files /dev/null and b/h-client/img/devices/big/bluetooth.png differ diff --git a/h-client/img/devices/big/fingerprint-reader.png b/h-client/img/devices/big/fingerprint-reader.png new file mode 100644 index 0000000..ba0e754 Binary files /dev/null and b/h-client/img/devices/big/fingerprint-reader.png differ diff --git a/h-client/img/devices/big/scanner.png b/h-client/img/devices/big/scanner.png new file mode 100755 index 0000000..4501fcf Binary files /dev/null and b/h-client/img/devices/big/scanner.png differ diff --git a/h-client/img/devices/big/webcam.png b/h-client/img/devices/big/webcam.png new file mode 100755 index 0000000..696bc13 Binary files /dev/null and b/h-client/img/devices/big/webcam.png differ diff --git a/h-client/img/devices/small/3G-card.png b/h-client/img/devices/small/3G-card.png new file mode 100755 index 0000000..97da84a Binary files /dev/null and b/h-client/img/devices/small/3G-card.png differ diff --git a/h-client/img/devices/small/acquisition-card.png b/h-client/img/devices/small/acquisition-card.png new file mode 100755 index 0000000..d4d2595 Binary files /dev/null and b/h-client/img/devices/small/acquisition-card.png differ diff --git a/h-client/img/devices/small/bluetooth.png b/h-client/img/devices/small/bluetooth.png new file mode 100755 index 0000000..c0b3f06 Binary files /dev/null and b/h-client/img/devices/small/bluetooth.png differ diff --git a/h-client/img/devices/small/fingerprint-reader.png b/h-client/img/devices/small/fingerprint-reader.png new file mode 100644 index 0000000..5593419 Binary files /dev/null and b/h-client/img/devices/small/fingerprint-reader.png differ diff --git a/h-client/img/devices/small/scanner.png b/h-client/img/devices/small/scanner.png new file mode 100755 index 0000000..d7b57e0 Binary files /dev/null and b/h-client/img/devices/small/scanner.png differ diff --git a/h-client/img/devices/small/webcam.png b/h-client/img/devices/small/webcam.png new file mode 100755 index 0000000..8a0b339 Binary files /dev/null and b/h-client/img/devices/small/webcam.png differ -- cgit v1.2.3