Logo Search packages:      
Sourcecode: audit version File versions  Download package

def watch_dialog::WatchDialog::_load_rule (   self,
  rule 
) [private]

Modify dialog controls to reflect rule.

Definition at line 56 of file watch_dialog.py.

00056                               :
        '''Modify dialog controls to reflect rule.'''
        assert rule.action == rule.ACTION_ALWAYS
        have_key = False
        have_path = False
        have_perm = False
        for f in rule.fields:
            if f.var == audit.AUDIT_FILTERKEY:
                assert not have_key
                have_key = True
                self.watch_key.set_text(f.value)
            elif f.var == audit.AUDIT_WATCH:
                assert not have_path
                have_path = True
                self.watch_path.set_text(f.value)
            elif f.var == audit.AUDIT_PERM:
                assert not have_perm
                have_perm = True
                self.watch_read.set_active((f.value & audit.AUDIT_PERM_READ) !=
                                           0)
                self.watch_write.set_active((f.value &
                                             audit.AUDIT_PERM_WRITE) != 0)
                self.watch_exec.set_active((f.value & audit.AUDIT_PERM_EXEC) !=
                                           0)
                self.watch_attr.set_active((f.value & audit.AUDIT_PERM_ATTR) !=
                                           0)
        if not have_key:
            self.watch_key.set_text('')
        self.watch_key_present.set_active(have_key)
        if not have_path:
            self.watch_path.set_text('')
        if not have_perm:
            for w in (self.watch_read, self.watch_write, self.watch_exec,
                      self.watch_attr):
                w.set_active(True)

    def _save_rule(self, rule):


Generated by  Doxygen 1.6.0   Back to index