Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clowdflows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Shakour
clowdflows
Commits
537c0bae
Commit
537c0bae
authored
Nov 04, 2013
by
Janez K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pohitritev
parent
b21c7ef5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
26 deletions
+17
-26
mothra/settings.py
mothra/settings.py
+1
-0
workflows/models.py
workflows/models.py
+15
-25
workflows/views.py
workflows/views.py
+1
-1
No files found.
mothra/settings.py
View file @
537c0bae
...
...
@@ -177,6 +177,7 @@ INSTALLED_APPS_DEFAULT = (
'workflows'
,
'picklefield'
,
'streams'
,
'debug_toolbar'
,
)
INSTALLED_APPS_CONCUR
=
(
...
...
workflows/models.py
View file @
537c0bae
...
...
@@ -383,22 +383,7 @@ class Widget(models.Model):
return
True
def
unfinish
(
self
):
if
self
.
finished
or
self
.
error
:
self
.
finished
=
False
self
.
error
=
False
self
.
progress
=
0
self
.
save
()
cons
=
Connection
.
objects
.
filter
(
output__widget
=
self
)
for
c
in
cons
:
if
c
.
input
.
widget
.
finished
:
c
.
input
.
widget
.
unfinish
()
if
self
.
type
==
'subprocess'
:
for
w
in
self
.
workflow_link
.
widgets
.
all
():
w
.
finished
=
False
w
.
error
=
False
w
.
save
()
if
w
.
type
==
'subprocess'
:
w
.
subunfinish
()
self
.
reset_descendants
()
def
subunfinish
(
self
):
if
self
.
type
==
'subprocess'
:
...
...
@@ -553,21 +538,23 @@ class Widget(models.Model):
return
None
def
reset
(
self
,
offline
):
for
i
in
self
.
inputs
.
defer
(
"value"
)
.
all
():
if
not
i
.
parameter
:
i
.
value
=
None
i
.
save
()
for
i
in
self
.
outputs
.
defer
(
"value"
)
.
all
():
i
.
value
=
None
i
.
save
()
#for i in self.inputs
.all():
#
if not i.parameter:
#
i.value = None
#
i.save()
#for i in self.outputs
.all():
#
i.value = None
#
i.save()
self
.
finished
=
False
self
.
error
=
False
self
.
running
=
False
self
.
save
()
if
self
.
type
==
'subprocess'
:
self
.
subunfinish
()
def
reset_descendants
(
self
):
#find all descendants and reset them as well
widgets
=
self
.
workflow
.
widgets
.
prefetch_related
(
'inputs'
,
'outputs'
,
'inputs__connections'
,
'outputs__connections'
,
'outputs__connections__input'
,
'inputs__connections__output'
)
widgets
=
list
(
self
.
workflow
.
widgets
.
prefetch_related
(
'inputs'
,
'outputs'
,
'inputs__connections'
,
'outputs__connections'
,
'outputs__connections__input'
,
'inputs__connections__output'
)
)
widgets_dict
=
{}
widgets_that_need_reset
=
set
([
self
.
pk
,])
current_widgets_that_need_reset
=
set
([
self
.
pk
,])
...
...
@@ -581,8 +568,11 @@ class Widget(models.Model):
new_widgets_that_need_reset
.
add
(
c
.
input
.
widget_id
)
widgets_that_need_reset
.
add
(
c
.
input
.
widget_id
)
current_widgets_that_need_reset
=
new_widgets_that_need_reset
Widget
.
objects
.
filter
(
id__in
=
widgets_that_need_reset
).
update
(
finished
=
False
,
error
=
False
,
running
=
False
)
for
w
in
widgets_that_need_reset
:
widgets_dict
[
w
].
reset
(
False
)
if
widgets_dict
[
w
].
type
==
'subprocess'
:
widgets_dict
[
w
].
subunfinish
()
# widgets_dict[w].reset(False)
return
widgets_that_need_reset
def
run_post
(
self
,
request
):
...
...
workflows/views.py
View file @
537c0bae
...
...
@@ -1082,7 +1082,7 @@ def unfinish_visualizations(request):
for
w
in
workflow
.
widgets
.
all
():
if
w
.
is_visualization
():
w
.
unfinish
()
w
.
save
()
#
w.save()
unfinished_list
.
append
(
w
.
pk
)
mimetype
=
'application/javascript'
data
=
simplejson
.
dumps
({
'unfinished'
:
unfinished_list
})
...
...
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