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
c22245e8
Commit
c22245e8
authored
Jun 04, 2013
by
Janez K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dodal haltstream exception
parent
5fa82106
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
41 deletions
+49
-41
mothra/settings.py
mothra/settings.py
+4
-4
streams/management/commands/run_streams.py
streams/management/commands/run_streams.py
+1
-1
streams/models.py
streams/models.py
+35
-32
workflows/streaming/library.py
workflows/streaming/library.py
+9
-4
No files found.
mothra/settings.py
View file @
c22245e8
...
...
@@ -186,10 +186,10 @@ INSTALLED_APPS_CONCUR = (
INSTALLED_APPS_WORKFLOWS_SUB
=
(
'workflows.base'
,
'workflows.latino'
,
#
'workflows.latino',
'workflows.decision_support'
,
'workflows.segmine'
,
'workflows.subgroup_discovery'
,
#
'workflows.subgroup_discovery',
'workflows.nlp'
,
'workflows.nl_toolkit'
,
'workflows.ilp'
,
...
...
@@ -197,8 +197,8 @@ INSTALLED_APPS_WORKFLOWS_SUB = (
'workflows.cforange'
,
'workflows.perfeval'
,
'workflows.mysql'
,
'workflows.lemmagen'
,
'workflows.crossbee'
,
#
'workflows.lemmagen',
#
'workflows.crossbee',
'workflows.streaming'
,
#WORKFLOWS_SUBAPP_PLACEHOLDER
)
...
...
streams/management/commands/run_streams.py
View file @
c22245e8
streams/models.py
View file @
c22245e8
...
...
@@ -5,6 +5,9 @@ import workflows.library
from
picklefield.fields
import
PickledObjectField
class
HaltStream
(
Exception
):
pass
# Create your models here.
class
Stream
(
models
.
Model
):
...
...
@@ -79,7 +82,7 @@ class Stream(models.Model):
output_dict
=
function_to_call
(
input_dict
,
w
,
self
)
else
:
output_dict
=
function_to_call
(
input_dict
)
except
:
except
HaltStream
:
halted
.
append
(
w
)
finish
=
False
...
...
workflows/streaming/library.py
View file @
c22245e8
...
...
@@ -4,6 +4,10 @@ Streaming widgets librarby
@author: Janez Kranjc <janez.kranjc@ijs.si>
'''
def
streaming_twitter
(
input_dict
,
widget
,
stream
=
None
):
output_dict
=
{}
return
output_dict
def
streaming_rss_reader
(
input_dict
,
widget
,
stream
=
None
):
import
feedparser
from
streams.models
import
StreamWidgetData
...
...
@@ -25,12 +29,13 @@ def streaming_rss_reader(input_dict,widget,stream=None):
feed_length
=
len
(
feed
[
'items'
])
feed
[
'items'
].
reverse
()
for
item
in
feed
[
'items'
]:
if
item
[
'
id
'
]
not
in
data
:
data
.
append
(
item
[
'
id
'
])
if
item
[
'
link
'
]
not
in
data
:
data
.
append
(
item
[
'
link
'
])
swd
.
value
=
data
swd
.
save
()
output_dict
[
'url'
]
=
item
[
'link'
]
break
else
:
raise
Exception
(
"Halting stream."
)
from
streams.models
import
HaltStream
raise
HaltStream
(
"Halting stream."
)
return
output_dict
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