Added StreamFileReader.as_manifest() back and added test for it.
[arvados.git] / sdk / python / arvados / __init__.py
index 18e762e89ef6c36a83bb72f4bcf124279c1da8d5..00f31caa6a13fcacd10f5c6a63e659c3894a2ce1 100644 (file)
@@ -18,28 +18,13 @@ import fcntl
 import time
 import threading
 
-EMPTY_BLOCK_LOCATOR = 'd41d8cd98f00b204e9800998ecf8427e+0'
-
 from api import *
-from stream import *
 from collection import *
 from keep import *
+from stream import *
+import errors
 import util
 
-class errors:
-    class SyntaxError(Exception):
-        pass
-    class AssertionError(Exception):
-        pass
-    class NotFoundError(Exception):
-        pass
-    class CommandFailedError(Exception):
-        pass
-    class KeepWriteError(Exception):
-        pass
-    class NotImplementedError(Exception):
-        pass
-
 def task_set_output(self,s):
     api('v1').job_tasks().update(uuid=self['uuid'],
                                  body={
@@ -74,6 +59,12 @@ def current_job():
 def getjobparam(*args):
     return current_job()['script_parameters'].get(*args)
 
+def get_job_param_mount(*args):
+    return os.path.join(os.environ['TASK_KEEPMOUNT'], current_job()['script_parameters'].get(*args))
+
+def get_task_param_mount(*args):
+    return os.path.join(os.environ['TASK_KEEPMOUNT'], current_task()['parameters'].get(*args))
+
 class JobTask(object):
     def __init__(self, parameters=dict(), runtime_constraints=dict()):
         print "init jobtask %s %s" % (parameters, runtime_constraints)