Merge branch 'master' of mus.cacr.caltech.edu:htsworkflow
[htsworkflow.git] / htsworkflow / util / rdfhelp.py
index 93b7ada645e876834319236359b3121c73f94c74..89d9e5b4d16290e940878d7cc6844d8b64d80c79 100644 (file)
@@ -419,6 +419,9 @@ def get_serializer(name='turtle'):
     return writer
 
 
-def dump_model(model):
+def dump_model(model, destination=None):
+    if destination is None:
+        destination = sys.stdout
     serializer = get_serializer()
-    print serializer.serialize_model_to_string(model)
+    destination.write(serializer.serialize_model_to_string(model))
+    destination.write(os.linesep)