Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages
usr
/
lib
/
python2.6
/
site-packages
/
📁
..
📁
Babel-0.9.4-py2.6.egg-info
📄
Markdown-2.0.1-py2.6.egg-info
(1.31 KB)
📁
Pygments-1.1.1-py2.6.egg-info
📁
argparse-1.2.1-py2.6.egg-info
📄
argparse.py
(85.73 KB)
📄
argparse.pyc
(65.1 KB)
📄
argparse.pyo
(64.93 KB)
📁
babel
📁
backports
📁
backports.ssl_match_hostname-3.4.0.2-py2.6.egg-info
📁
boto
📁
boto-2.34.0-py2.6.egg-info
📁
chardet
📁
chardet-2.2.1-py2.6.egg-info
📁
clcommon
📄
clsudo.py
(12.65 KB)
📄
clsudo.pyc
(11.13 KB)
📄
clsudo.pyo
(11.13 KB)
📄
configobj-4.6.0-py2.6.egg-info
(312 B)
📄
configobj.py
(84.42 KB)
📄
configobj.pyc
(64.86 KB)
📄
configobj.pyo
(64.86 KB)
📁
dbus
📄
dbus_bindings.py
(33 B)
📄
dbus_bindings.pyc
(185 B)
📄
dbus_bindings.pyo
(185 B)
📁
distribute-0.6.10-py2.6.egg-info
📄
easy_install.py
(126 B)
📄
easy_install.pyc
(317 B)
📄
easy_install.pyo
(317 B)
📄
hwdata.py
(5.89 KB)
📄
hwdata.pyc
(4.44 KB)
📄
hwdata.pyo
(4.44 KB)
📁
iniparse
📄
iniparse-0.3.1-py2.6.egg-info
(1.06 KB)
📁
jsonpatch-1.2-py2.6.egg-info
📄
jsonpatch.py
(15.57 KB)
📄
jsonpatch.pyc
(17.07 KB)
📄
jsonpatch.pyo
(16.87 KB)
📄
jsonpointer-1.0-py2.6.egg-info
(302 B)
📄
jsonpointer.py
(6.46 KB)
📄
jsonpointer.pyc
(6.22 KB)
📄
jsonpointer.pyo
(6.22 KB)
📄
libproxy.py
(4.23 KB)
📄
libproxy.pyc
(3.9 KB)
📄
libproxy.pyo
(3.9 KB)
📁
markdown
📁
oauth
📁
oauth-1.0.1-py2.6.egg-info
📄
pciutils-1.7.3-py2.6.egg-info
(267 B)
📁
pip
📁
pip-7.1.0-py2.6.egg-info
📄
pkg_resources.py
(86.13 KB)
📄
pkg_resources.pyc
(90.7 KB)
📄
pkg_resources.pyo
(90.7 KB)
📁
prettytable-0.7.2-py2.6.egg-info
📄
prettytable.py
(52.93 KB)
📄
prettytable.pyc
(51.03 KB)
📄
prettytable.pyo
(50.06 KB)
📁
pygments
📁
pyzor
📁
pyzor-1.0.0-py2.6.egg-info
📁
requests
📄
requests-2.6.0-py2.6.egg-info
(39.41 KB)
📁
rhn
📄
rhnlib-2.5.22-py2.6.egg-info
(339 B)
📁
rpmUtils
📄
secureio.py
(9.01 KB)
📄
secureio.pyc
(4.61 KB)
📄
secureio.pyo
(4.61 KB)
📁
setools
📁
setuptools
📄
setuptools-0.6c11-py2.6.egg-info
(144 B)
📄
setuptools.pth
(34 B)
📄
site.py
(2.31 KB)
📄
site.pyc
(1.73 KB)
📄
site.pyo
(1.73 KB)
📄
six-1.9.0-py2.6.egg-info
(1.39 KB)
📄
six.py
(28.97 KB)
📄
six.pyc
(29.18 KB)
📄
six.pyo
(29.18 KB)
📁
sos
📁
supervisor
📄
supervisor-2.1-py2.6.egg-info
(797 B)
📁
urlgrabber
📄
urlgrabber-3.9.1-py2.6.egg-info
(2.23 KB)
📁
urllib3
📁
urllib3-1.10.2-py2.6.egg-info
📄
validate.py
(45.67 KB)
📄
validate.pyc
(46.27 KB)
📄
validate.pyo
(46.27 KB)
📁
yum
📁
yumutils
Editing: hwdata.py
# # Copyright (c) 1999--2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 # along with this software; if not, see # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. # # Red Hat trademarks are not licensed under GPLv2. No permission is # granted to use or replicate Red Hat trademarks that are incorporated # in this software or its documentation. # """ Query hwdata database and return decription of vendor and/or device. """ class USB: """ Interace to usb.ids from hwdata package """ filename = '/usr/share/hwdata/usb.ids' devices = None def __init__(self, filename=None): """ Load pci.ids from file to internal data structure. parameter 'filename' can specify location of this file """ if filename: self.filename = filename else: self.filename = USB.filename self.cache = 1 if self.cache and not USB.devices: # parse usb.ids USB.devices = {} for line in open(self.filename).readlines(): l = line.split() if line.startswith('#'): if line.startswith('# List of known device classes, subclasses and protocols'): break # end of database of devices, rest is protocols, types etc. else: continue elif len(l) == 0: continue elif line.startswith('\t\t'): interface_id = l[0].lower() if len(l) > 2: interface_name = ' '.join(l[1:]) else: interface_name = '' USB.devices[vendor][1][device][0][interface_id] = interface_name elif line.startswith('\t'): device = l[0].lower() device_name = ' '.join(l[1:]) USB.devices[vendor][1][device] = [device_name, {}] else: vendor = l[0].lower() vendor_name = ' '.join(l[1:]) if vendor not in USB.devices: USB.devices[vendor] = [vendor_name, {}] else: # this should not happen USB.devices[vendor][0] = vendor_name def get_vendor(self, vendor): """ Return description of vendor. Parameter is two byte code in hexa. If vendor is unknown None is returned. """ vendor = vendor.lower() if self.cache: if vendor in USB.devices: return USB.devices[vendor][0] else: return None else: raise # not implemented yet def get_device(self, vendor, device): """ Return description of device. Parameters are two byte code variables in hexa. If device is unknown None is returned. """ vendor = vendor.lower() device = device.lower() if self.cache: if vendor in USB.devices: if device in USB.devices[vendor][1]: return USB.devices[vendor][1][device][0] else: return None else: return None else: raise # not implemented yet class PCI: """ Interace to pci.ids from hwdata package """ filename = '/usr/share/hwdata/pci.ids' devices = None def __init__(self, filename=None): """ Load pci.ids from file to internal data structure. parameter 'filename' can specify location of this file """ if filename: self.filename = filename else: self.filename = PCI.filename self.cache = 1 if self.cache and not PCI.devices: # parse pci.ids pcirec = {} PCI.devices = {} for line in open(self.filename).readlines(): l = line.split() if line.startswith('#'): continue elif len(l) == 0: continue elif line.startswith('\t\t'): continue elif line.startswith('\t'): device = l[0].lower() device_name = ' '.join(l[1:]) PCI.devices[vendor][1][device] = device_name else: vendor = l[0].lower() vendor_name = ' '.join(l[1:]) if not vendor in list(PCI.devices.keys()): PCI.devices[vendor] = [vendor_name, {}] else: # this should not happen PCI.devices[vendor][0] = vendor_name def get_vendor(self, vendor): """ Return description of vendor. Parameter is two byte code in hexa. If vendor is unknown None is returned. """ vendor = vendor.lower() if self.cache: if vendor in list(PCI.devices.keys()): return PCI.devices[vendor][0] else: return None else: raise # not implemented yet def get_device(self, vendor, device): """ Return description of device. Parameters are two byte code variables in hexa. If device is unknown None is returned. """ vendor = vendor.lower() device = device.lower() if self.cache: if vendor in list(PCI.devices.keys()): if device in list(PCI.devices[vendor][1].keys()): return PCI.devices[vendor][1][device] else: return None else: return None else: raise # not implemented yet
Upload File
Create Folder