home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / apport / package-hooks / source_jockey.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  932 b   |  26 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os.path as os
  5. import os
  6. import apport.hookutils as apport
  7. XORG_CONF = '/etc/X11/xorg.conf'
  8.  
  9. def add_info(report):
  10.     
  11.     try:
  12.         report['XorgConf'] = open(XORG_CONF).read()
  13.     except IOError:
  14.         pass
  15.  
  16.     report['Devices'] = ''
  17.     for dirpath, dirnames, filenames in os.walk('/sys/devices'):
  18.         if 'modalias' in filenames:
  19.             modalias = open(os.path.join(dirpath, 'modalias')).read().strip()
  20.             report['Devices'] += modalias + '\n'
  21.             continue
  22.     
  23.     apport.hookutils.attach_file_if_exists(report, '/var/log/jockey.log')
  24.     apport.hookutils.attach_hardware(report)
  25.  
  26.