|  |  |  |  | 
| Nautilus.InfoProviderNautilus.InfoProvider — Nautilus.InfoProvider Reference | 
Nautilus.InfoProvider {update_file_info(file);update_file_info_full(provider,
handle,
closure,
file);cancel_update(provider,
handle);Nautilus.info_provider_update_complete_invoke(provider,
handle,
closure,
result= Nautilus.OperationResult.COMPLETE);
}
If subclassed, Nautilus will call update_file_info(_full) to notify extensions of which files are being viewed by the user. This gives extensions an opportunity to invoke actions on the files, or to add emblems or attributes.
Example 3. Nautilus.InfoProvider Example
from gi.repository import Nautilus, GObject
class UpdateFileInfoAsync(GObject.GObject, Nautilus.InfoProvider):
    def __init__(self):
        self.timers = []
        pass
    
    def update_file_info_full(self, provider, handle, closure, file):
        print("update_file_info_full")
        self.timers.append(GObject.timeout_add_seconds(3, self.update_cb, provider, handle, closure))
        return Nautilus.OperationResult.IN_PROGRESS
        
    def update_cb(self, provider, handle, closure):
        print("update_cb")
        Nautilus.info_provider_update_complete_invoke(closure, provider, handle, Nautilus.OperationResult.FAILED)
    def cancel_update(self, provider, handle):
        print("cancel_update")
        for t in self.timers:
            GObject.source_remove(t)
        self.timers = []
    update_file_info(file);| 
 | a Nautilus.FileInfoobject | 
This method is called by Nautilus for each file or folder that exists under the current directory listing. There is no return value.
update_file_info_full(provider,
                      handle,
                      closure,
                      file);| 
 | the current Nautilus.InfoProviderinstance | 
| 
 | a gobject.gpointergenerated solely to track this call | 
| 
 | a C Closure that must be passed to Nautilus.info_provider_update_complete_invoke if that method is called | 
| 
 | a Nautilus.FileInfoobject | 
| Returns : | None or a Nautilus.OperationResultenum | 
                This method is called by Nautilus for each file or folder that exists under the
                current directory listing.  Originally, Nautilus.InfoProvider
                only provided the update_file_info
                method, which blocked Nautilus when the method required a lot of computation time.  This method was 
                created to allow an extension to tell Nautilus that it will be spending time on an operation and that
                Nautilus should not block itself during that time.
          
                In order to notify Nautilus of your extension's intentions, you must return a 
                Nautilus.OperationResult enum.  
                Then, when the operation has completed, call the Nautilus.info_provider_update_complete_invoke method, passing the provider, 
                handle and closure variables as parameters.
          
                This method was created for backwards compatibility reasons.  If your
                extension used the update_file_info method and you want non-blocking 
                usage, you should switch to this method.
          
cancel_update(provider,
              handle);| 
 | the current Nautilus.InfoProviderinstance | 
| 
 | a gobject.gpointergenerated by a specific update_file_info_full call | 
            This method is called by Nautilus when an update_file_info_full call is in progress
            but is no longer required.  This may happen because the user is moving directories or a file
            has been deleted, etc.  You may use the handle parameter here to match the
            handle parameter passed in update_file_info_full.
          
info_provider_update_complete_invoke(provider,
                                     handle,
                                     closure,
                                     result= Nautilus.OperationResult.COMPLETE);| 
 | the current Nautilus.InfoProviderinstance | 
| 
 | a gobject.gpointergenerated by a specific update_file_info_full call | 
| 
 | a C Closure that must be passed to Nautilus.info_provider_update_complete_invoke if that method is called | 
| 
 | an optional parameter.  If left out, Nautilus.OperationResult.COMPLETENautilus.OperationResultenums. | 
            An extension must call this method for each update_file_info_full method that
            returns the Nautilus.OperationResult.IN_PROGRESSupdate_file_info_full method.