summaryrefslogtreecommitdiff
path: root/src/dh_xul-ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/dh_xul-ext')
-rwxr-xr-xsrc/dh_xul-ext17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dh_xul-ext b/src/dh_xul-ext
index 3592663..8447e01 100755
--- a/src/dh_xul-ext
+++ b/src/dh_xul-ext
@@ -29,8 +29,7 @@ import sys
from moz_version import compare_versions
-from rdflib import Namespace
-from rdflib.Graph import Graph
+import RDF
# error codes
COMMAND_LINE_SYNTAX_ERROR = 1
@@ -47,10 +46,12 @@ def get_xul_apps():
def get_supported_apps(script_name, xul_apps, install_rdf, package, verbose=False):
# create array of id_max_min triples
id_max_min = []
- rdf_graph = Graph()
- rdf_graph.parse(install_rdf)
- results = rdf_graph.query(
+ model = RDF.Model()
+ parser = RDF.Parser(name="rdfxml")
+ stream = parser.parse_into_model(model, "file:" + install_rdf)
+ query = RDF.Query(
"""
+ PREFIX em: <http://www.mozilla.org/2004/em-rdf#>
SELECT ?id ?max ?min
WHERE {
?x1 em:targetApplication ?x2 .
@@ -60,11 +61,11 @@ def get_supported_apps(script_name, xul_apps, install_rdf, package, verbose=Fals
?x2 em:minVersion ?min .
} .
}
- """, initNs=dict(em=Namespace("http://www.mozilla.org/2004/em-rdf#")))
-
+ """, query_language="sparql")
+ results = query.execute(model)
# append to id_max_min tripe to array
for target in results:
- id_max_min.append (( str(target[0]), str(target[1]), str (target[2]) ))
+ id_max_min.append (( str(target["id"]), str(target["max"]), str (target["min"]) ))
if verbose:
print "%s: %s supports %i XUL application(s):" % (script_name, package, len(id_max_min))