class Actor(DeviceActor):

    __required__ = {'linux.hotplug_type': 3,
                    'volume.fstype': 'ntfs-3g',
                    'volume.is_disc': False
                    }


    def __init__(self, msgr, devprop):
        DeviceActor.__init__(self, msgr, devprop)

        self.volume_actor = VolumeActor(self.msg_render,
                self.properties)


    def on_added(self):
        self.logger.debug('<#>ntfs on_added</#>')
        block_device = self.properties['block.device']
        os.system('pmount %s' % block_device)

        mount_point = '/media/'
        mount_point += block_device.split('/')[-1]
        self.mount_point = mount_point

        self.properties['volume.mount_point'] = mount_point
        self.properties['volume.is_mounted'] = True

        self.volume_actor.properties = self.properties

        self.volume_actor.on_added()


    def on_removed(self):
        self.logger.debug('<#>ntfs on_removed</#>')
        self.volume_actor.properties = self.properties
        self.volume_actor.on_removed()


    def on_modified(self, key):
        self.logger.debug('<#>ntfs on_modified</#>')
        self.logger.debug('<#> %s </#>' % self.properties['volume.is_mounted'])
        self.volume_actor.properties = self.properties
        self.volume_actor.on_modified(key)
Пример #2
0
class Actor(DeviceActor):

    __required__ = {
        'linux.hotplug_type': 3,
        'volume.fstype': 'ntfs-3g',
        'volume.is_disc': False
    }

    def __init__(self, msgr, devprop):
        DeviceActor.__init__(self, msgr, devprop)

        self.volume_actor = VolumeActor(self.msg_render, self.properties)

    def on_added(self):
        self.logger.debug('<#>ntfs on_added</#>')
        block_device = self.properties['block.device']
        os.system('pmount %s' % block_device)

        mount_point = '/media/'
        mount_point += block_device.split('/')[-1]
        self.mount_point = mount_point

        self.properties['volume.mount_point'] = mount_point
        self.properties['volume.is_mounted'] = True

        self.volume_actor.properties = self.properties

        self.volume_actor.on_added()

    def on_removed(self):
        self.logger.debug('<#>ntfs on_removed</#>')
        self.volume_actor.properties = self.properties
        self.volume_actor.on_removed()

    def on_modified(self, key):
        self.logger.debug('<#>ntfs on_modified</#>')
        self.logger.debug('<#> %s </#>' % self.properties['volume.is_mounted'])
        self.volume_actor.properties = self.properties
        self.volume_actor.on_modified(key)
 def new_on_modified(volume_actor, prop_name):
     Actor.old_on_modified(volume_actor, prop_name)
     if prop_name == 'volume.is_mounted' and \
             volume_actor.properties['volume.is_mounted']:
         self.hack(volume_actor)
Пример #4
0
 def new_on_modified(volume_actor, prop_name):
     Actor.old_on_modified(volume_actor, prop_name)
     if prop_name == 'volume.is_mounted' and \
             volume_actor.properties['volume.is_mounted']:
         self.hack(volume_actor)
Пример #5
0
    def __init__(self, msgr, devprop):
        DeviceActor.__init__(self, msgr, devprop)

        self.volume_actor = VolumeActor(self.msg_render, self.properties)
    def __init__(self, msgr, devprop):
        DeviceActor.__init__(self, msgr, devprop)

        self.volume_actor = VolumeActor(self.msg_render,
                self.properties)