summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2020-11-23 20:48:12 +0100
committerSam Thursfield <sam@afuera.me.uk>2020-12-17 16:27:07 +0100
commit0da4cd399ea9417e90a8290a1c3b0a734284a212 (patch)
tree900abf721a0fd4050fb34c90899d4cd9975dcc38 /examples
parent98585df9d00a9e57cf6687a56c001ad455f68256 (diff)
downloadtracker-0da4cd399ea9417e90a8290a1c3b0a734284a212.tar.gz
examples: Move Python query examples to tracker-miners.
These query the Miner FS, so they should go with it.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/python/query-async.py25
-rwxr-xr-xexamples/python/query-sync.py9
2 files changed, 0 insertions, 34 deletions
diff --git a/examples/python/query-async.py b/examples/python/query-async.py
deleted file mode 100755
index 1077052dc..000000000
--- a/examples/python/query-async.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-import gi
-from gi.repository import Tracker, GObject
-
-def results_ready_cb (obj, result, user_data):
- cursor = obj.query_finish (result)
-
- # This can also be done asynchronously
- while (cursor.next (None)):
- print cursor.get_string (0)
-
- user_data.quit ()
-
-
-if __name__ == "__main__":
- loop = GObject.MainLoop ()
-
- # The connection can be requested asynchronously
- conn = Tracker.SparqlConnection.get (None)
- conn.query_async ("SELECT nie:url(?u) WHERE { ?u a nfo:FileDataObject }",
- None,
- results_ready_cb,
- loop)
-
- loop.run ()
diff --git a/examples/python/query-sync.py b/examples/python/query-sync.py
deleted file mode 100755
index cf8bfd6f6..000000000
--- a/examples/python/query-sync.py
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python
-import gi
-from gi.repository import Tracker
-
-conn = Tracker.SparqlConnection.get (None)
-cursor = conn.query ("SELECT ?u WHERE { ?u a nie:InformationElement. }", None)
-
-while (cursor.next (None)):
- print cursor.get_string (0)