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

def lib::sources::gconfsource::GConfSource::start_monitoring (   self  ) 

Start monitoring for GConf changes. Note that this
is seriously resource intensive as must load the value
of all existing keys so that we can determine whether
a write to the database resulted in an actual change
in the value of the key.

Reimplemented from lib::userprofile::ProfileSource.

Definition at line 189 of file gconfsource.py.

00189                                :
        """Start monitoring for GConf changes. Note that this
        is seriously resource intensive as must load the value
        of all existing keys so that we can determine whether
        a write to the database resulted in an actual change
        in the value of the key.
        """
        if self.notify_id != 0:
            return
        
        def handle_notify (client, cnx_id, entry, self):
            dprint ("Got GConf notification on '%s'", entry.key)
            
            for ignore_pattern in GCONF_KEYS_TO_IGNORE:
                if fnmatch.fnmatchcase (entry.key, ignore_pattern):
                    dprint ("Ignoring GConf notification on '%s' because it matches '%s'",
                            entry.key, ignore_pattern)
                    return
                
            value = None
            if not entry.get_is_default ():
                value = entry.value
            
            self.emit_change (GConfChange (self, entry.key, value))

        # Only monitor for changes in the user settings database
        (self.client, address) = get_client_and_address_for_path (os.path.join (self.home_dir, ".gconf"))
        self.client.add_dir ("/", gconf.CLIENT_PRELOAD_RECURSIVE)
        self.notify_id = self.client.notify_add ("/", handle_notify, self)

    def stop_monitoring (self):


Generated by  Doxygen 1.6.0   Back to index