summaryrefslogtreecommitdiff
path: root/examples/gio/directory-async.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gio/directory-async.py')
-rw-r--r--examples/gio/directory-async.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/gio/directory-async.py b/examples/gio/directory-async.py
new file mode 100644
index 00000000..30e22e3d
--- /dev/null
+++ b/examples/gio/directory-async.py
@@ -0,0 +1,14 @@
+import gobject
+import gio
+import gtk
+
+def callback(gfile, result):
+ for file_info in gfile.enumerate_children_finish(result):
+ print file_info.get_name()
+ loop.quit()
+
+gfile = gio.File("/")
+gfile.enumerate_children_async("standard::*", callback)
+
+loop = gobject.MainLoop()
+loop.run()