Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
be39ed6d
Commit
be39ed6d
authored
Sep 24, 2015
by
LE GAC Renaud
Browse files
Propagate the method _insert_in_db to all automatons.
parent
bc78f8c5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
99 deletions
+126
-99
modules/harvest_tools/articles.py
modules/harvest_tools/articles.py
+4
-5
modules/harvest_tools/notes.py
modules/harvest_tools/notes.py
+21
-16
modules/harvest_tools/preprints.py
modules/harvest_tools/preprints.py
+22
-18
modules/harvest_tools/proceedings.py
modules/harvest_tools/proceedings.py
+7
-3
modules/harvest_tools/reports.py
modules/harvest_tools/reports.py
+23
-18
modules/harvest_tools/talks.py
modules/harvest_tools/talks.py
+26
-21
modules/harvest_tools/thesis.py
modules/harvest_tools/thesis.py
+23
-18
No files found.
modules/harvest_tools/articles.py
View file @
be39ed6d
...
...
@@ -284,6 +284,7 @@ class Articles(Automaton):
# eventually insert a new articles in the database
# try to improve the rescue list for CPPM authors
ret
=
1
if
not
self
.
dry_run
:
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
...
...
@@ -312,10 +313,8 @@ class Articles(Automaton):
id_team
=
self
.
id_team
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
else
:
ret
=
1
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
ret
return
0
modules/harvest_tools/notes.py
View file @
be39ed6d
...
...
@@ -83,20 +83,25 @@ class Notes(Automaton):
return
status
# eventually insert a new report
ret
=
1
if
not
self
.
dry_run
:
db
.
publications
.
insert
(
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
publication_url
=
record
.
paper_url
(),
report_numbers
=
record
.
report_number
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
publication_url
=
record
.
paper_url
(),
report_numbers
=
record
.
report_number
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
year
=
year
)
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
modules/harvest_tools/preprints.py
View file @
be39ed6d
...
...
@@ -111,22 +111,26 @@ class Preprints(Automaton):
return
status
# eventually insert a new preprint
ret
=
1
if
not
self
.
dry_run
:
db
.
publications
.
insert
(
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
preprint
=
preprint
,
publication_url
=
record
.
paper_url
(),
submitted
=
submitted
,
title
=
title
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
preprint
=
preprint
,
publication_url
=
record
.
paper_url
(),
submitted
=
submitted
,
title
=
title
,
year
=
year
)
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
modules/harvest_tools/proceedings.py
View file @
be39ed6d
...
...
@@ -119,6 +119,7 @@ class Proceedings(Automaton):
return
status
# eventually insert a new proceeding
ret
=
1
if
not
self
.
dry_run
:
dic
=
dict
(
authors
=
authors
,
...
...
@@ -146,7 +147,10 @@ class Proceedings(Automaton):
volume
=
volume
,
year
=
year
)
db
.
publications
[
0
]
=
di
c
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
**
di
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
modules/harvest_tools/reports.py
View file @
be39ed6d
...
...
@@ -102,22 +102,27 @@ class Reports(Automaton):
return
status
# eventually insert a new report
ret
=
1
if
not
self
.
dry_run
:
db
.
publications
.
insert
(
authors
=
authors
,
authors_institute
=
authors_institute
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_projects
=
self
.
id_project
,
id_status
=
id_status
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
preprint
=
record
.
preprint_number
(),
publication_url
=
record
.
paper_url
(),
report_numbers
=
record
.
report_number
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
authors
=
authors
,
authors_institute
=
authors_institute
,
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_projects
=
self
.
id_project
,
id_status
=
id_status
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
preprint
=
record
.
preprint_number
(),
publication_url
=
record
.
paper_url
(),
report_numbers
=
record
.
report_number
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
year
=
year
)
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
modules/harvest_tools/talks.py
View file @
be39ed6d
...
...
@@ -94,25 +94,30 @@ class Talks(Automaton):
return
status
# eventually insert a new talk
ret
=
1
if
not
self
.
dry_run
:
db
.
publications
.
insert
(
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
conference_dates
=
conference_dates
,
conference_speaker
=
first_author
,
conference_title
=
conference_title
,
conference_town
=
record
.
conference_town
(),
conference_url
=
record
.
conference_url
(),
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_countries
=
id_country
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
submitted
=
submitted
,
title
=
title
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
authors
=
record
.
authors
(),
authors_institute
=
record
.
my_authors
,
conference_dates
=
conference_dates
,
conference_speaker
=
first_author
,
conference_title
=
conference_title
,
conference_town
=
record
.
conference_town
(),
conference_url
=
record
.
conference_url
(),
first_author
=
first_author
,
id_categories
=
self
.
id_category
,
id_collaborations
=
id_collaboration
,
id_countries
=
id_country
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
id_teams
=
self
.
id_team
,
origin
=
oai_url
,
submitted
=
submitted
,
title
=
title
,
year
=
year
)
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
modules/harvest_tools/thesis.py
View file @
be39ed6d
...
...
@@ -99,22 +99,27 @@ class Thesis(Automaton):
return
status
# eventually insert a new thesis
ret
=
1
if
not
self
.
dry_run
:
db
.
publications
.
insert
(
authors
=
first_author
,
authors_institute
=
first_author
,
defense
=
defense_date
,
directors
=
record
.
these_directors
(),
first_author
=
first_author
,
id_categories
=
id_category
,
id_teams
=
self
.
id_team
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
origin
=
oai_url
,
publication_url
=
record
.
paper_url
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
universities
=
universities
,
year
=
year
)
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
ret
=
self
.
_insert_in_db
(
log_year
=
year
,
authors
=
first_author
,
authors_institute
=
first_author
,
defense
=
defense_date
,
directors
=
record
.
these_directors
(),
first_author
=
first_author
,
id_categories
=
id_category
,
id_teams
=
self
.
id_team
,
id_projects
=
self
.
id_project
,
id_status
=
UNDEF_ID
,
origin
=
oai_url
,
publication_url
=
record
.
paper_url
(),
submitted
=
record
.
submitted
()[
0
],
title
=
title
,
universities
=
universities
,
year
=
year
)
if
ret
==
1
:
self
.
logs
[
-
1
].
load
(
MSG_LOAD
,
year
)
return
1
return
0
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