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
ea2c34dd
Commit
ea2c34dd
authored
Dec 22, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://delanoe.org:1979/gargantext
into samuel
parents
5ebf3ec3
897f1f71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
init.py
init.py
+0
-1
EuropressFileParser.py
parsing/FileParsers/EuropressFileParser.py
+12
-12
No files found.
init.py
View file @
ea2c34dd
...
...
@@ -37,7 +37,6 @@ metadata = {
'source'
:
'string'
,
'volume'
:
'string'
,
'text'
:
'text'
,
'date'
:
'datetime'
,
'page'
:
'string'
,
'doi'
:
'string'
,
'journal'
:
'string'
,
...
...
parsing/FileParsers/EuropressFileParser.py
View file @
ea2c34dd
...
...
@@ -70,10 +70,10 @@ class EuropressFileParser(FileParser):
self
.
localeEncoding
=
"fr_FR"
locale
.
setlocale
(
locale
.
LC_ALL
,
localeEncoding
)
try
:
metadata
[
'date'
]
=
datetime
.
strptime
(
text
,
'
%
d
%
B
%
Y'
)
metadata
[
'
publication_
date'
]
=
datetime
.
strptime
(
text
,
'
%
d
%
B
%
Y'
)
except
:
try
:
metadata
[
'date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
Y'
)
metadata
[
'
publication_
date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
Y'
)
except
:
pass
...
...
@@ -81,10 +81,10 @@ class EuropressFileParser(FileParser):
localeEncoding
=
"en_GB.UTF-8"
locale
.
setlocale
(
locale
.
LC_ALL
,
localeEncoding
)
try
:
metadata
[
'date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
d,
%
Y'
)
metadata
[
'
publication_
date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
d,
%
Y'
)
except
:
try
:
metadata
[
'date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
Y'
)
metadata
[
'
publication_
date'
]
=
datetime
.
strptime
(
text
,
'
%
B
%
Y'
)
except
:
pass
...
...
@@ -118,19 +118,19 @@ class EuropressFileParser(FileParser):
try
:
if
metadata
[
'
date'
]
is
not
None
or
metadata
[
'
date'
]
!=
''
:
if
metadata
[
'
publication_date'
]
is
not
None
or
metadata
[
'publication_
date'
]
!=
''
:
try
:
back
=
metadata
[
'date'
]
back
=
metadata
[
'
publication_
date'
]
except
Exception
as
e
:
print
(
e
)
pass
else
:
try
:
metadata
[
'date'
]
=
back
metadata
[
'
publication_
date'
]
=
back
except
Exception
as
e
:
print
(
e
)
except
:
metadata
[
'date'
]
=
datetime
.
now
()
metadata
[
'
publication_
date'
]
=
datetime
.
now
()
#if lang == 'fr':
#metadata['language_iso2'] = 'fr'
...
...
@@ -138,10 +138,10 @@ class EuropressFileParser(FileParser):
# metadata['language_iso2'] = 'en'
metadata
[
'publication_year'
]
=
metadata
[
'date'
]
.
strftime
(
'
%
Y'
)
metadata
[
'publication_month'
]
=
metadata
[
'date'
]
.
strftime
(
'
%
m'
)
metadata
[
'publication_day'
]
=
metadata
[
'date'
]
.
strftime
(
'
%
d'
)
metadata
[
'date'
]
=
""
#
metadata['publication_year'] = metadata['date'].strftime('%Y')
#
metadata['publication_month'] = metadata['date'].strftime('%m')
#
metadata['publication_day'] = metadata['date'].strftime('%d')
metadata
[
'
publication_
date'
]
=
""
metadata
[
'object_id'
]
=
str
(
metadata
[
'text'
][
-
9
])
metadata
[
'text'
]
.
pop
()
...
...
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