~peer.loz/sbackup/next

« back to all changes in this revision

Viewing changes to src/sbackup/auto/conditions/device_plugin.py

  • Committer: Jean-Peer Lorenz
  • Date: 2014-08-21 19:49:30 UTC
  • Revision ID: peer.loz@gmx.net-20140821194930-3znr02yzr1q94wzi
continue work on auto-backup gui

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    
45
45
    def __init__(self, settings):
46
46
        ConditionFactory.__init__(self, settings)
47
 
        if self._settings['Type'] != 'UsbDeviceAvailable':
 
47
#         if self._settings['Type'] != 'UsbDeviceAvailable':
 
48
        if self._settings['Type'] != DeviceAvailCondition.name:
48
49
            raise ValueError
49
50
        self._dfltr = UdevFilter('usb', 'usb_device',
50
51
                        {'ID_SERIAL':(self._settings['IdSerial'])}, {})
57
58
 
58
59
class DeviceAvailCondition(Condition):
59
60
    is_primary = True
 
61
    name = 'UsbDeviceAvailable'
60
62
    
61
63
    def __init__(self, udev_filter, info_props):
62
64
        Condition.__init__(self)