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
Labels
Merge Requests
143
Merge Requests
143
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
31df31cb
Commit
31df31cb
authored
Jun 23, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a patch of DCWorkflowGraph.
This is needed, because graph was not drawn.
parent
8ed6f61e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+1
-0
product/ERP5Type/patches/DCWorkflowGraph.py
product/ERP5Type/patches/DCWorkflowGraph.py
+51
-0
No files found.
product/ERP5Type/ZopePatch.py
View file @
31df31cb
...
...
@@ -28,6 +28,7 @@ from Products.ERP5Type.patches import PropertyManager
from
Products.ERP5Type.patches
import
TM
from
Products.ERP5Type.patches
import
DA
from
Products.ERP5Type.patches
import
DCWorkflow
from
Products.ERP5Type.patches
import
DCWorkflowGraph
from
Products.ERP5Type.patches
import
Worklists
from
Products.ERP5Type.patches
import
BTreeFolder2
from
Products.ERP5Type.patches
import
WorkflowTool
...
...
product/ERP5Type/patches/DCWorkflowGraph.py
0 → 100644
View file @
31df31cb
#########################################################################
# This code is taken from Products.DCWorkflowGraph-0.4-py2.6.egg
# http://pypi.python.org/pypi/Products.DCWorkflowGraph
# Author: panjunyong (panjy at zopen.cn, from ZOpen) <panjy at zopen cn>
# License: ZPL
# The license term should be this one: http://www.zope.org/Resources/ZPL
#########################################################################
try
:
from
Products.DCWorkflowGraph
import
DCWorkflowGraph
from
Products.DCWorkflowGraph.DCWorkflowGraph
import
(
getPOT
,
mktemp
,
os
,
bin_search
,
DOT_EXE
)
except
ImportError
:
DCWorkflowGraph
=
None
if
DCWorkflowGraph
is
not
None
:
def
getGraph
(
self
,
wf_id
=
""
,
format
=
"gif"
,
REQUEST
=
None
):
"""show a workflow as a graph, copy from:
"OpenFlowEditor":http://www.openflow.it/wwwopenflow/Download/OpenFlowEditor_0_4.tgz
"""
pot
=
getPOT
(
self
,
wf_id
,
REQUEST
)
encoding
=
'utf-8'
#### PATCHED
pot
=
pot
.
encode
(
encoding
)
infile
=
mktemp
(
'.dot'
)
f
=
open
(
infile
,
'w'
)
f
.
write
(
pot
)
f
.
close
()
if
REQUEST
is
None
:
REQUEST
=
self
.
REQUEST
response
=
REQUEST
.
RESPONSE
if
format
!=
'dot'
:
outfile
=
mktemp
(
'.%s'
%
format
)
os
.
system
(
'%s -T%s -o %s %s'
%
(
bin_search
(
DOT_EXE
),
format
,
outfile
,
infile
))
out
=
open
(
outfile
,
'rb'
)
result
=
out
.
read
()
out
.
close
()
os
.
remove
(
outfile
)
response
.
setHeader
(
'Content-Type'
,
'image/%s'
%
format
)
else
:
result
=
open
(
infile
,
'r'
).
read
()
filename
=
wf_id
or
self
.
getId
()
response
.
setHeader
(
'Content-Type'
,
'text/x-graphviz'
)
response
.
setHeader
(
'Content-Disposition'
,
'attachment; filename=%s.dot'
%
filename
)
os
.
remove
(
infile
)
return
result
from
Products.DCWorkflow.DCWorkflow
import
DCWorkflowDefinition
DCWorkflowDefinition
.
getGraph
=
getGraph
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