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
76298b45
Commit
76298b45
authored
Feb 03, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] ensure temp user-dir if not exists
parent
ae23856c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
MedlineFetcherDavid2015.py
scrap_pubmed/MedlineFetcherDavid2015.py
+5
-0
views.py
scrap_pubmed/views.py
+2
-0
No files found.
scrap_pubmed/MedlineFetcherDavid2015.py
View file @
76298b45
...
...
@@ -83,6 +83,11 @@ class MedlineFetcher:
eFetch
=
'
%
s/efetch.fcgi?email=youremail@example.org&rettype=
%
s&retmode=xml&retstart=
%
s&retmax=
%
s&db=
%
s&query_key=
%
s&WebEnv=
%
s'
%
(
self
.
pubMedEutilsURL
,
self
.
reportType
,
retstart
,
retmax
,
self
.
pubMedDB
,
queryKey
,
webEnv
)
return
eFetch
def
ensure_dir
(
self
,
f
):
d
=
os
.
path
.
dirname
(
f
)
if
not
os
.
path
.
exists
(
d
):
os
.
makedirs
(
d
)
# generic!
def
downloadFile
(
self
,
item
):
url
=
item
[
0
]
...
...
scrap_pubmed/views.py
View file @
76298b45
...
...
@@ -15,6 +15,7 @@ import json
from
gargantext_web.settings
import
MEDIA_ROOT
from
datetime
import
datetime
import
time
import
os
import
threading
from
django.core.files
import
File
from
gargantext_web.settings
import
DEBUG
...
...
@@ -83,6 +84,7 @@ def doTheQuery(request , project_id):
try
:
tasks
=
MedlineFetcher
()
tasks
.
ensure_dir
(
MEDIA_ROOT
+
'/corpora/'
+
str
(
request
.
user
)
+
"/"
)
# configuring your queue with the event
for
i
in
range
(
8
):
t
=
threading
.
Thread
(
target
=
tasks
.
worker2
)
#thing to do
...
...
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