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
7cd20adb
Commit
7cd20adb
authored
Jun 09, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] location.reload OFF
parent
8b42c51a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
48 deletions
+5
-48
views.py
scrappers/scrap_pubmed/views.py
+2
-45
project.html
templates/project.html
+3
-3
No files found.
scrappers/scrap_pubmed/views.py
View file @
7cd20adb
...
@@ -269,7 +269,8 @@ def testISTEX(request , project_id):
...
@@ -269,7 +269,8 @@ def testISTEX(request , project_id):
type_id
=
resourcetype
.
id
,
type_id
=
resourcetype
.
id
,
file
=
filename
,
file
=
filename
,
)
)
dwnldsOK
+=
1
dwnldsOK
+=
1
if
dwnldsOK
==
0
:
return
JsonHttpResponse
([
"fail"
])
# print(urlreqs)
# print(urlreqs)
...
@@ -287,50 +288,6 @@ def testISTEX(request , project_id):
...
@@ -287,50 +288,6 @@ def testISTEX(request , project_id):
return
HttpResponseRedirect
(
'/project/'
+
str
(
project_id
))
return
HttpResponseRedirect
(
'/project/'
+
str
(
project_id
))
# resource_type = ResourceType.objects.get(name="istext" )
# parent = Node.objects.get(id=project_id)
# node_type = NodeType.objects.get(name='Corpus')
# type_id = NodeType.objects.get(name='Document').id
# user_id = User.objects.get( username=request.user ).id
# corpus = Node(
# user=request.user,
# parent=parent,
# type=node_type,
# name=query,
# )
# corpus.save()
# # configuring your queue with the event
# for i in range(8):
# t = threading.Thread(target=tasks.worker2) #thing to do
# t.daemon = True # thread dies when main thread (only non-daemon thread) exits.
# t.start()
# for url in urlreqs:
# filename = MEDIA_ROOT + '/corpora/%s/%s' % (request.user, str(datetime.now().microsecond))
# tasks.q.put( [url , filename]) #put a task in th queue
# tasks.q.join() # wait until everything is finished
# for filename in tasks.firstResults:
# corpus.add_resource( user=request.user, type=resource_type, file=filename )
# corpus.save()
# print("DEBUG:",DEBUG)
# # do the WorkFlow
# try:
# if DEBUG is True:
# corpus.workflow()
# else:
# corpus.workflow.apply_async((), countdown=3)
# return JsonHttpResponse(["workflow","finished"])
# except Exception as error:
# print(error)
data
=
[
query_string
,
query
,
N
]
data
=
[
query_string
,
query
,
N
]
return
JsonHttpResponse
(
data
)
return
JsonHttpResponse
(
data
)
templates/project.html
View file @
7cd20adb
...
@@ -264,9 +264,9 @@
...
@@ -264,9 +264,9 @@
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
"in doTheQuery()"
)
console
.
log
(
"in doTheQuery()
Ajax.Success:
"
)
console
.
log
(
data
)
console
.
log
(
data
)
location
.
reload
();
//
location.reload();
},
},
error
:
function
(
result
)
{
error
:
function
(
result
)
{
console
.
log
(
"in doTheQuery(). Data not found"
);
console
.
log
(
"in doTheQuery(). Data not found"
);
...
@@ -502,7 +502,7 @@
...
@@ -502,7 +502,7 @@
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
"ajax_success: in testISTEX()"
)
console
.
log
(
"ajax_success: in testISTEX()"
)
console
.
log
(
data
)
console
.
log
(
data
)
location
.
reload
();
//
location.reload();
},
},
error
:
function
(
result
)
{
error
:
function
(
result
)
{
console
.
log
(
"in testISTEX(). Data not found"
);
console
.
log
(
"in testISTEX(). Data not found"
);
...
...
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