Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
4047fcc7
Commit
4047fcc7
authored
Dec 08, 2016
by
Loic Esteve
Committed by
Hardik Juneja
Oct 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move class definitions inside ENABLE_JOBLIB block
parent
88ad9ff6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
product/CMFActivity/ActivityJoblibBackend.py
product/CMFActivity/ActivityJoblibBackend.py
+29
-29
No files found.
product/CMFActivity/ActivityJoblibBackend.py
View file @
4047fcc7
...
...
@@ -43,7 +43,8 @@ except ImportError:
LOG
(
"CMFActivityBackend"
,
WARNING
,
"CLASS NOT LOADED!!!"
)
ENABLE_JOBLIB
=
False
class
MySafeFunction
(
SafeFunction
):
if
ENABLE_JOBLIB
:
class
MySafeFunction
(
SafeFunction
):
"""Wrapper around a SafeFunction that catches any exception
The exception can be handled in CMFActivityResult.get
...
...
@@ -54,7 +55,7 @@ class MySafeFunction(SafeFunction):
except
Exception
as
exc
:
return
exc
class
CMFActivityResult
(
object
):
class
CMFActivityResult
(
object
):
def
__init__
(
self
,
active_process
,
callback
):
self
.
active_process
=
active_process
self
.
callback
=
callback
...
...
@@ -74,7 +75,6 @@ class CMFActivityResult(object):
self
.
callback
(
result
)
return
result
if
ENABLE_JOBLIB
:
class
CMFActivityBackend
(
ParallelBackendBase
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
zope_context
=
kwargs
[
'zope_context'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment