summaryrefslogtreecommitdiff
path: root/examples/update-file-info-async.py
diff options
context:
space:
mode:
authorPatrick Monnerat <[email protected]>2019-01-26 15:22:58 +0100
committerVictor Kareh <[email protected]>2019-01-30 15:59:07 -0500
commit6447d7c97a71521f2cdc0765a81c20aec8b90e04 (patch)
treea9c36cae6fb6e7ef26b52845cd36c32fe87f07fd /examples/update-file-info-async.py
parenta6a1bed0d97285ad9fabff9a5116f5b6a0e2c000 (diff)
downloadpython-caja-6447d7c97a71521f2cdc0765a81c20aec8b90e04.tar.bz2
python-caja-6447d7c97a71521f2cdc0765a81c20aec8b90e04.tar.xz
Modernize examples
The example extension scripts need to be in sync with new versions of referenced foreign packages. This commit also makes them compatible with Python version 3 (retaining Python 2 compatibility). An additional example extension "mixed" is added: it implements all caja extension features and can also be used as a new extension pattern. See source header comment for a description. Ref: https://github.com/mate-desktop/python-caja/pull/34#issuecomment-457257832
Diffstat (limited to 'examples/update-file-info-async.py')
-rw-r--r--examples/update-file-info-async.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/update-file-info-async.py b/examples/update-file-info-async.py
index 8da2235..e0dd3b3 100644
--- a/examples/update-file-info-async.py
+++ b/examples/update-file-info-async.py
@@ -5,10 +5,13 @@ class UpdateFileInfoAsync(GObject.GObject, Caja.InfoProvider):
pass
def update_file_info_full(self, provider, handle, closure, file):
- print "update_file_info_full"
+ print('update_file_info_full')
GLib.timeout_add_seconds(3, self.update_cb, provider, handle, closure)
return Caja.OperationResult.IN_PROGRESS
def update_cb(self, provider, handle, closure):
- print "update_cb"
+ print('update_cb')
Caja.info_provider_update_complete_invoke(closure, provider, handle, Caja.OperationResult.FAILED)
+
+ def cancel_update(self, provider, handle):
+ print('cancel_update')