File: update-file-info-async.py

package info (click to toggle)
nemo-python 5.6.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 384 kB
  • sloc: xml: 1,732; ansic: 795; python: 157; makefile: 9
file content (15 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from gi.repository import Nemo, GObject

class UpdateFileInfoAsync(GObject.GObject, Nemo.InfoProvider):
    def __init__(self):
        super(UpdateFileInfoAsync, self).__init__()
        pass

    def update_file_info_full(self, provider, handle, closure, file):
        print "update_file_info_full"
        gobject.timeout_add_seconds(3, self.update_cb, provider, handle, closure)
        return Nemo.OperationResult.IN_PROGRESS

    def update_cb(self, provider, handle, closure):
        print "update_cb"
        Nemo.info_provider_update_complete_invoke(closure, provider, handle, Nemo.OperationResult.FAILED)