Commits

Anonymous committed 5082706

trnasaction helpers and bump version

Comments (0)

Files changed (2)

ordf/handler/__init__.py

         self.store = dummy.store
 
 
+class DummyTransaction(object):
+    def __enter__(self):
+        return self
+    def __exit__(self, *av, **kw):
+        pass
+    def commit(self):
+        pass
+    def rollback(self):
+        pass
+    
 class Handler(object):
     """
     Handle reading and writing of RDF Graphs
             #prefixes = ["PREFIX %s: <%s>" % (k, namespaces[k]) for k in namespaces]
             #q = "\n".join(prefixes) + "\n" + q
             return self.rdflib.query(q)
+        elif hasattr(self, "surf"):
+            return self.surf.query(q)
         else:
             raise AttributeError("No SPARQL Implementations")
 
-        
+    def transaction(self):
+        for h in self.__writers__:
+            if hasattr(h, "transaction"):
+                return h
+        return DummyTransaction()
+    
 class HandlerPlugin(object):
     """
     Instances of this class implement read and/or write operations on storage
 from setuptools import setup, find_packages
 import sys, os
 
-version = '0.33'
+version = '0.34'
 
 try:
     from mercurial import ui, hg, error