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
4650a42d
Commit
4650a42d
authored
Apr 03, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] ResourceType added.
parent
7e618718
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
14 deletions
+21
-14
init2.sql
init/init2.sql
+4
-0
init_gargantext.py
init/init_gargantext.py
+3
-4
models.py
node/models.py
+14
-10
No files found.
init/init2.sql
0 → 100644
View file @
4650a42d
ALTER
TABLE
ONLY
node_node
ALTER
COLUMN
date
SET
DEFAULT
CURRENT_DATE
;
init/init_gargantext.py
View file @
4650a42d
...
@@ -99,11 +99,10 @@ for node_type in node_types:
...
@@ -99,11 +99,10 @@ for node_type in node_types:
print
(
'Initialize resource...'
)
print
(
'Initialize resource...'
)
resources
=
[
from
parsing.parsers_config
import
parsers
'pubmed'
,
'isi'
,
'ris'
,
'europress_french'
,
'europress_english'
]
for
resource
in
resources
:
for
parser
in
parsers
.
keys
()
:
models
.
ResourceType
.
objects
.
get_or_create
(
name
=
resource
)
models
.
ResourceType
.
objects
.
get_or_create
(
name
=
parser
)
...
...
node/models.py
View file @
4650a42d
...
@@ -29,6 +29,7 @@ from celery import current_app
...
@@ -29,6 +29,7 @@ from celery import current_app
import
os
import
os
import
subprocess
import
subprocess
from
parsing.parsers_config
import
parsers
# Some usefull functions
# Some usefull functions
# TODO: start the function name with an underscore (private)
# TODO: start the function name with an underscore (private)
...
@@ -194,16 +195,19 @@ class Node(CTENode):
...
@@ -194,16 +195,19 @@ class Node(CTENode):
print
(
"= = = = = = = = = = =
\n
"
)
print
(
"= = = = = = = = = = =
\n
"
)
for
node_resource
in
self
.
node_resource
.
filter
(
parsed
=
False
):
for
node_resource
in
self
.
node_resource
.
filter
(
parsed
=
False
):
resource
=
node_resource
.
resource
resource
=
node_resource
.
resource
parser
=
defaultdict
(
lambda
:
FileParser
.
FileParser
,
{
parser
=
defaultdict
(
lambda
:
FileParser
.
FileParser
,
parsers
'istext'
:
ISText
,
# {
'pubmed'
:
PubmedFileParser
,
# 'istext' : ISText,
'isi'
:
IsiFileParser
,
# 'pubmed' : PubmedFileParser,
'ris'
:
RisFileParser
,
# 'isi' : IsiFileParser,
'RIS (Jstor)'
:
JstorFileParser
,
# 'ris' : RisFileParser,
'europress'
:
EuropressFileParser
,
# 'RIS (Jstor)' : JstorFileParser,
'europress_french'
:
EuropressFileParser
,
# 'europress' : EuropressFileParser,
'europress_english'
:
EuropressFileParser
,
# 'europress_french' : EuropressFileParser,
})[
resource
.
type
.
name
]()
# 'europress_english' : EuropressFileParser,
# }
)[
resource
.
type
.
name
]()
metadata_list
+=
parser
.
parse
(
str
(
resource
.
file
))
metadata_list
+=
parser
.
parse
(
str
(
resource
.
file
))
type_id
=
NodeType
.
objects
.
get
(
name
=
'Document'
)
.
id
type_id
=
NodeType
.
objects
.
get
(
name
=
'Document'
)
.
id
langages_cache
=
LanguagesCache
()
langages_cache
=
LanguagesCache
()
...
...
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