Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
53cf1e47
Commit
53cf1e47
authored
Apr 20, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] sheduled function, still a bug.
parent
5714b98f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
pubmed.py
scrapers/pubmed.py
+5
-5
urls.py
scrapers/urls.py
+2
-2
No files found.
scrapers/pubmed.py
View file @
53cf1e47
...
...
@@ -74,12 +74,12 @@ def save( request , project_id ) :
except
ValueError
:
raise
Http404
()
# do we have a valid project?
project
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
project_id
)
.
first
()
if
project
is
None
:
raise
Http404
()
user
=
cache
.
User
[
request
.
user
.
id
]
if
not
user
.
owns
(
project
):
...
...
@@ -132,12 +132,12 @@ def save( request , project_id ) :
tasks
.
q
.
join
()
# wait until everything is finished
dwnldsOK
=
0
for
filename
in
tasks
.
firstResults
:
print
(
filename
)
if
filename
!=
False
:
# add the uploaded resource to the corpus
corpus
.
add_resource
(
corpus
.
add_resource
(
type
=
3
,
path
=
filename
)
...
...
@@ -146,7 +146,7 @@ def save( request , project_id ) :
if
dwnldsOK
==
0
:
return
JsonHttpResponse
([
"fail"
])
try
:
scheduled
(
parse_extract_indexhyperdata
)(
corpus_id
)
scheduled
(
parse_extract_indexhyperdata
(
corpus_id
)
)
except
Exception
as
error
:
print
(
'WORKFLOW ERROR'
)
print
(
error
)
...
...
scrapers/urls.py
View file @
53cf1e47
...
...
@@ -40,6 +40,6 @@ urlpatterns = [ url(r'^pubmed/query$' , pubmed.query )
,
url
(
r'^istex/save/(\d+)'
,
istex
.
save
)
# TODO
#, url(r'^
cern
/query$' , cern.query )
#, url(r'^
cern
/save/(\d+)' , cern.save )
#, url(r'^
scoap3
/query$' , cern.query )
#, url(r'^
scoap3
/save/(\d+)' , cern.save )
]
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