~mvo/jockey/b43-firmware-loading-fixes

« back to all changes in this revision

Viewing changes to jockey/handlers.py

  • Committer: Martin Pitt
  • Date: 2010-07-29 19:32:41 UTC
  • mto: This revision was merged to the branch mainline in revision 422.
  • Revision ID: martin.pitt@canonical.com-20100729193241-msm1j5yj9q0pegst
add flag file based auto install mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
            raise NotImplementedError, 'subclasses need to implement this'
168
168
 
169
169
    def auto_install(self):
170
 
        '''Return if the handler should be automatically installed.'''
171
 
 
172
 
        return self._auto_install
 
170
        '''Return if the handler should be automatically installed.
 
171
 
 
172
        This can be done by hardcoding self._auto_install = True, but the
 
173
        recommended approach is to create a flag file
 
174
        <handler_dir>/autoinstall.d/<driver id>, because that is easier to
 
175
        customize.
 
176
        '''
 
177
        if self._auto_install:
 
178
            return True
 
179
 
 
180
        # check autoinstall.d/ flag
 
181
        if os.path.exists(os.path.join(OSLib.inst.handler_dir, 'autoinstall.d', self.id())):
 
182
            return True
 
183
 
 
184
        return False
173
185
 
174
186
    def enabled(self):
175
187
        '''Return if the handler is enabled.