Commit 4047fcc7 authored by Loic Esteve's avatar Loic Esteve Committed by Hardik Juneja

Move class definitions inside ENABLE_JOBLIB block

parent 88ad9ff6
...@@ -43,7 +43,8 @@ except ImportError: ...@@ -43,7 +43,8 @@ except ImportError:
LOG("CMFActivityBackend", WARNING, "CLASS NOT LOADED!!!") LOG("CMFActivityBackend", WARNING, "CLASS NOT LOADED!!!")
ENABLE_JOBLIB = False ENABLE_JOBLIB = False
class MySafeFunction(SafeFunction): if ENABLE_JOBLIB:
class MySafeFunction(SafeFunction):
"""Wrapper around a SafeFunction that catches any exception """Wrapper around a SafeFunction that catches any exception
The exception can be handled in CMFActivityResult.get The exception can be handled in CMFActivityResult.get
...@@ -54,7 +55,7 @@ class MySafeFunction(SafeFunction): ...@@ -54,7 +55,7 @@ class MySafeFunction(SafeFunction):
except Exception as exc: except Exception as exc:
return exc return exc
class CMFActivityResult(object): class CMFActivityResult(object):
def __init__(self, active_process, callback): def __init__(self, active_process, callback):
self.active_process = active_process self.active_process = active_process
self.callback = callback self.callback = callback
...@@ -74,7 +75,6 @@ class CMFActivityResult(object): ...@@ -74,7 +75,6 @@ class CMFActivityResult(object):
self.callback(result) self.callback(result)
return result return result
if ENABLE_JOBLIB:
class CMFActivityBackend(ParallelBackendBase): class CMFActivityBackend(ParallelBackendBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.zope_context = kwargs['zope_context'] self.zope_context = kwargs['zope_context']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment