~ubuntu-branches/ubuntu/trusty/jockey/trusty

« back to all changes in this revision

Viewing changes to jockey/detection.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-04-12 09:08:49 UTC
  • Revision ID: package-import@ubuntu.com-20120412090849-so3r4ju1tuo33ssq
Tags: 0.9.7-0ubuntu7
* debian/tests/control: Add dbus-x11 dependency to get dbus-launch.
  (LP: #976239)
* data/handlers/fglrx.py: Fix crash if there is no other alternative for the
  driver. (LP: #954297)
* Merge from trunk:
  - Fix crash if there is no notification daemon available. (LP: #819755)
  - jockey/detection.py: Do not show a warning about not being able to open
    the DriverDB cache if the file does not exist. (LP: #888273)
  - Update Bulgarian translations from Launchpad.

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
            assert self._cache_id()
169
169
            self.cache_path = os.path.join(OSLib.inst.backup_dir,
170
170
                'driverdb-%s.cache' % self._cache_id())
171
 
            try:
172
 
                self.cache = pickle.load(open(self.cache_path, 'rb'))
173
 
            except (pickle.PickleError, IOError) as e:
174
 
                logging.warning('Could not open DriverDB cache %s: %s',
175
 
                    self.cache_path, str(e))
176
 
                self.cache = None
 
171
            if os.path.exists(self.cache_path):
 
172
                try:
 
173
                    self.cache = pickle.load(open(self.cache_path, 'rb'))
 
174
                except (pickle.PickleError, IOError) as e:
 
175
                    logging.warning('Could not open DriverDB cache %s: %s',
 
176
                        self.cache_path, str(e))
 
177
                    self.cache = None
177
178
 
178
179
    def query(self, hwid):
179
180
        '''Return a set or list of applicable DriverIDs for a HardwareID.