Commit cf3697da authored by Administrator's avatar Administrator

[FEATURE] VIEW PARSING If for each type of bdd.

parent 5b91c3c6
...@@ -21,7 +21,7 @@ from django import forms ...@@ -21,7 +21,7 @@ from django import forms
from collections import defaultdict from collections import defaultdict
#from parsing.FileParsers import * from parsing.FileParsers import *
# SOME FUNCTIONS # SOME FUNCTIONS
...@@ -162,13 +162,20 @@ def project(request, project_id): ...@@ -162,13 +162,20 @@ def project(request, project_id):
node.save() node.save()
node.resource.add(resource) node.resource.add(resource)
# try: try:
# for resource in node.resource.all(): for resource in node.resource.all():
# fileparser = PubmedFileParser.PubmedFileParser(file='/var/www/gargantext/media/' + str(resource.file)) print(resource.bdd_type.name)
# fileparser.parse(node) if resource.bdd_type.name == "PubMed":
# fileparser = PubmedFileParser(file='/var/www/gargantext/media/' + str(resource.file))
# except Exception as error: fileparser.parse(node)
# print(error) elif resource.bdd_type.name == "Web Of Science (WOS), ISI format":
fileparser = IsiParser(file='/var/www/gargantext/media/' + str(resource.file))
fileparser.parse(node)
elif node.bdd_type.name == "Europresse":
pass
except Exception as error:
print(error)
return HttpResponseRedirect('/project/' + str(project_id)) return HttpResponseRedirect('/project/' + str(project_id))
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment