Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Prod for legacy #3384

Closed
wants to merge 190 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
6617f8f
DocExtract: preload kbs on wsgi load
jmartinm Oct 25, 2013
cf2623a
PdfChecker: skip records without unique ids in 037 tags
Osso Oct 25, 2013
491bab4
WebSearch: add more info on verbose output
jalavik Dec 4, 2013
f785288
BibIndex: special journal page handling
jalavik Dec 9, 2013
5be85cc
WebSearch: special journal search fallback
jalavik Dec 9, 2013
d0ef306
BibAuthorID: hotfix in author-hepnames connection
WohthaN Dec 11, 2013
f6bcb2c
BibAuthorID: fix in WAPAFF format
WohthaN Dec 11, 2013
2a51e0e
BibAuthorID: javascript ticket system optimization
minnsoe Dec 20, 2013
82a2a74
datacher: minimum caching time
Osso Jan 8, 2014
847f59a
BibRank: details citations diff
Osso Jan 9, 2014
fd9b381
BibAuthorId: Fixed bibref selection dropdown bug in claiming system.
minnsoe Jan 30, 2014
59332cf
BibAuthorID: fixed name resolution problem
WohthaN Jan 30, 2014
9c7a3b7
BibSched: query_cache_type disabled for bibtasks
kaplun Feb 11, 2014
ca01a97
WebStyle: false positive HTTP errors
kaplun Feb 11, 2014
63cce37
BibAuthoriID: fix crash on /manage_profile without args
WohthaN Feb 11, 2014
20e56a0
Bibrank: avoid error when getting keyword
jmartinm Feb 11, 2014
14a2f10
WebStyle: avoid error on invalid headers
jmartinm Feb 11, 2014
5771725
htmlutils: extract transform links function
jmartinm Feb 11, 2014
95010b0
BibFormat: bfe_meta KeyError fix
jmartinm Feb 11, 2014
6744d54
WebStyle: handle client disconnects gracefully
Osso Feb 11, 2014
47984aa
WebStyle: silence ClientDisconncted exceptions
Osso Feb 12, 2014
6b6b343
htmlutils: HTMLParser from site-packages
kaplun Feb 12, 2014
79aded6
BibAuthorID: fix wrong string replacement in assertion
WohthaN Feb 11, 2014
7cd9456
BibAuthorID: fix in import_publication_from_orcid
WohthaN Feb 12, 2014
3fc9361
shellutils: only escape when there are args
jalavik Feb 12, 2014
8010246
crossrefutils: handle UnboundLocalError
jalavik Feb 13, 2014
4a1112d
WebSession: improve data error handling
jalavik Feb 12, 2014
d389440
errorlib: modify register_exception function
Feb 6, 2014
2af4afd
WebSearch: fix call to BibClassify
jalavik Feb 13, 2014
116e87c
BibFormat: adds repr to BibFormatObject
jalavik Feb 13, 2014
280f21c
BibRank: stop on citation losses
Osso Feb 12, 2014
4320b94
BibFormat: assert that recid is an integer in constructor
jmartinm Feb 12, 2014
4b23e79
errorlib: reraise ClientDisconnected and KeyboardInterrupt
Osso Feb 14, 2014
77c44c2
BibFormat: assert that recid is an integer or a long in constructor
Osso Feb 14, 2014
b69743f
OPS: print stack in BibFormat.__init__
Osso Feb 14, 2014
d07b117
BibFormat: make recid an int in bfe_dataset_appears
Osso Feb 14, 2014
fb43b0f
BibRank: amends lost citations display
Osso Feb 18, 2014
230b85e
BibRank: wrong diffs when checking citation losses
Osso Feb 18, 2014
a8d58dc
BibRank: do not exit on per record losses
jalavik Feb 20, 2014
2ffc030
BibExport: export_fulltext flag in sitemap.cfg
kaplun Feb 26, 2014
93390b2
RefExtract: accept Publications as reference section
Osso Feb 26, 2014
f9b083b
RefExtract: refactored book handling
Osso Aug 28, 2013
f9f4f27
BibFomat: EndNote support for doi
kaplun Mar 5, 2014
1397932
errorlib: display correct line in stack traces
Osso Mar 7, 2014
c90d6a7
BibDocFile: do not create AFS volume if pattern is empty
Osso Mar 7, 2014
2eeb9f2
DocExtract: LIGO report numbers
Osso Mar 10, 2014
3c5056c
BibAuthorID: exception when merging profiles
Osso Mar 10, 2014
1ac5eb1
pdfchecker: check modified records on arXiv
kaplun Mar 14, 2014
7b25b00
BibRank: faster indexing
Osso Mar 19, 2014
2e5b1e4
RefExtract: tweaks to book recognition
Osso Mar 4, 2014
66ccdf7
BibUpload: call wash_for_xml() on input
kaplun Mar 25, 2014
66f7c3d
BibFormat: accepting xml without a 001 tag
Osso Mar 7, 2014
e83144e
BibConvert: update authorlist2marcxml XSLT
Aug 8, 2013
13e6877
BibRank: faster searches with * queries
Osso Mar 27, 2014
0a86121
RefExtract: filename in 999C6f
Osso Mar 27, 2014
aea836a
bibauthorid: change hepnames js source
jmartinm Apr 3, 2014
7ffb66e
OPS: disable garbage collection
Osso Apr 8, 2014
322f8cc
WebStyle: broken json when profiling
Osso Apr 10, 2014
cf4c0d2
BibRank: fix redis cache check
jalavik Apr 13, 2014
4bf7c9c
BibRank: bug in citation weights storage
Osso Apr 14, 2014
82ad419
Revert "BibRank: fix redis cache check"
Osso Apr 14, 2014
e6ff8bf
BibDocFile: complete 3004c20 AFS fix
jalavik Apr 23, 2014
6cf8722
BibAuthorID: get_papers_affected_since() timestamp
kaplun Apr 28, 2014
8d63ede
hepdatautils: incremental harvest support
Apr 30, 2014
27b1164
WebSearch: date after, date before bug fix
May 7, 2014
b363d3a
dbdump: use ping() to re-establish connection
tsgit May 14, 2014
b28e99d
WebAccess: temporary exception dump (OPS)
WohthaN Jun 6, 2014
a9aa091
RefExtract: selective ref section title detection
Osso Jun 18, 2014
145d87f
PdfChecker: no arxiv queries on regression tests
Osso Jun 19, 2014
9ff1d81
travis: temporary fix to travis (OPS)
jalavik Jun 17, 2014
59ba8ae
BibRank: superseeded records
Osso Jun 24, 2014
40302a3
BibFormat: format records without recids
Osso Jun 24, 2014
ea55939
BibRank: amends tests
Osso Jun 24, 2014
b4f6214
BibRank: index all collections
Osso Jun 24, 2014
a842dd7
inveniocfg: affiliations in atlantis
Osso Jun 25, 2014
829ce9e
installation: more fixes to load demo records
Osso Jun 25, 2014
586233d
DocExtract: fixes for regression tests
Osso Jun 25, 2014
e518623
BibIndex: journal index tests
Osso Jun 25, 2014
ab37595
Revert "datacher: minimum caching time"
Osso Jun 27, 2014
48fb18d
installation: aidAFFILIATIONS in tabdrop/tabibclean
Osso Jun 27, 2014
6c3517f
WebSearch: valid datetimes from spires query parser
Osso Jun 27, 2014
b05821a
BibDocFile: ignore purely numerical extensions
tsgit Jun 3, 2014
dddbce6
BibRank: superseeded records catchup
Osso Jun 26, 2014
55d69f3
WebSearch: renames HepData tab
Jun 25, 2014
3a10f79
WebSearch: outdated unit tests
Osso Jun 27, 2014
a60ddf5
BibMatch: Removed redundant string_partition import.
Jul 2, 2014
77548eb
BibAuthorID: Modified default directory for tortoise cache.
Jul 3, 2014
66bc872
BibAuthorID: check for valid person ids
Osso Jul 9, 2014
48b56a0
OPS: disable author pages during upgrade
kaplun Jul 14, 2014
7dc8cd5
OPS: re-enabling author-pages
kaplun Jul 14, 2014
76cc9a0
WebSearch: filtering of citation tab counts
Osso Jul 18, 2014
b0ba75a
Revert "BibRank: index all collections"
Osso Jul 18, 2014
ae8c268
Revert "BibRank: faster indexing"
Osso Jul 18, 2014
b3df32b
BibRank: left over cites for deleted records
Osso Jul 18, 2014
fbcae1b
BibSched: tracebacks with context
Osso Jul 18, 2014
2dee7dc
WebSearch: debug text for citation log
Osso Jul 21, 2014
875d796
WebSearch: overwritten recid variable in citation tab
Osso Jul 21, 2014
bcbfab9
DocExtract: better error message when pdftotext is missing
Osso Jul 28, 2014
85542ec
BibAuthorID: APPP internal papers in external pub
Jul 21, 2014
9782a67
BibIndex: outdated regression tests
Osso Jul 28, 2014
cfc9083
BibIndex: reliable tests cleanup
Osso Jul 30, 2014
46bd1ea
WebSearch: date operators `<=` and `>=`
Jul 28, 2014
b5f8b1b
BibIndex: tweaks to virtual index tests
Osso Jul 31, 2014
a033828
BibIndex: duplicate year in virtual index tests
Osso Jul 31, 2014
be2f6d6
travis: pypi mirror
Osso Aug 1, 2014
d6ce016
travis: move apt-get update
Osso Aug 1, 2014
18a7ea9
travis: silencing output
Osso Aug 1, 2014
3ae9c92
dbquery: accept mariadb 10.x in unit tests
Osso Aug 4, 2014
ae003d9
BibAuthorID: APPP tickets concurrency fix
Aug 4, 2014
215a476
BibRank: debug output for report numbers catchup
Osso Aug 6, 2014
b56f14d
BibRank: disable losses checks
Osso Aug 6, 2014
e465068
BibRank: incomplete option parsing
Osso Aug 7, 2014
67cac2c
BibAuthorID: Handling of timeouts when connecting to crossref.
Aug 7, 2014
ae0acf5
BibRank: no exception on single record cite loss
Osso Aug 7, 2014
def325d
BibIndex: improve virtual index queue tests
Aug 15, 2014
ef2cd57
BibIndex: test concurrent bibupload and bibindex
Osso Aug 14, 2014
300e745
BibIndex: do not use hstRECORD
Aug 13, 2014
6d7d199
BibFormat: HTML validation fixes for citation tab
tsgit Aug 16, 2014
a9e3aaa
BibAuthorID: Fixed handling of timeouts when fetching titles.
Aug 18, 2014
701342a
WebLinkback: reliable linkback sorting
Osso Aug 26, 2014
031714c
BibRank: bibxxx ids in selfcites tables
Osso Aug 25, 2014
b1d3477
MiscUtil: detect Apache version
Osso Aug 13, 2014
3227300
Drone: add .drone.yml
Aug 12, 2014
2a16130
BibCheck: properly reset last_run timestamp
kaplun Apr 11, 2014
04834d6
OPS: properly have ingestion_date everywhere
kaplun Sep 15, 2014
1daff5b
Refextract: handle lower case volume letters
Osso Sep 25, 2014
0adbb0d
Refextract: Adds tests for -- in report numbers
Osso Sep 25, 2014
5e1de25
Docextract: adds 2 lhcp report numbers
Osso Sep 25, 2014
c12a928
Bibsched: status getters
Sep 3, 2014
008e916
BibSched: post-process data exchange
Sep 10, 2014
5ee6059
WebSearch: webcoll post-process data
Sep 10, 2014
2a5fac5
travis: rename index
jalavik Oct 10, 2014
fb0021a
redisutils: remove Nydus routing
jalavik Oct 17, 2014
2c05b56
BibCatalog: fix username check
jalavik Oct 23, 2014
7172f2f
(OPS) revert to original .travis.yml file
kaplun Nov 7, 2014
3c62cf3
(OPS) WebSearch: fix regression test WRT services
kaplun Nov 7, 2014
c639967
WebStyle: no crash in invenio.wsgi initialisation
kaplun Nov 11, 2014
469a30d
BibSearch: fix keyerror for hidden tags
tsgit Nov 21, 2014
94d4c57
OAIHarvest: do filtering first (OPS)
jalavik Nov 21, 2014
a1eb6c6
BibSched: add more logging when tasks have errors
jalavik Nov 28, 2014
eebfd7a
general: support for arXiv 5-digits IDs
kaplun Dec 10, 2014
0505274
BibEdit: remove non-existing RT key
jmartinm Dec 15, 2014
f94e69f
OPS OAIHarvest: fix bug introduced before
kaplun Dec 15, 2014
5a9d163
OPS: use my devscript with no pip upgrade
kaplun Jan 5, 2015
892686a
WebSearch: selfcites in SPIRES syntax
kaplun Jan 8, 2015
0535765
Revert "BibEdit: remove non-existing RT key"
tsgit Jan 9, 2015
10ecf61
BibCatalog: exception logging fix
tsgit Jan 11, 2015
3058068
miscutil: texkey generator improvement
jmartinm Jan 22, 2015
193068b
OPS BibUpload: check PDF is actually a PDF
kaplun Jan 23, 2015
c7d5b47
pdfchecker: missing PDF support
kaplun Jan 26, 2015
7d4582b
WebSession: page_not_authorized fix
jalavik Jan 30, 2015
d897ece
BibCheck: collection-based filters and timestamps
Oct 14, 2014
4ddfafe
BibCheck: missing subfield code
kaplun Jan 30, 2015
799cf16
BibRank: update bibindex when using Solr
kaplun Feb 2, 2015
64333fe
BibIndex: infinite loop in beautify_range_list
kaplun Feb 10, 2015
4f3ce62
Miscutil: forbid using delete character in xmls
Feb 13, 2015
30e8169
BibSched: bibtask polling
kaplun Feb 13, 2015
2e76fd4
BibFormat: outdated_caches() fix
kaplun Feb 26, 2015
219e047
WebStyle: improved HTTP error code
kaplun Feb 27, 2015
0cf6889
DocExtract: non ascii chars in build_journals_kb()
kaplun Mar 17, 2015
0dc48eb
BibIndex: repair workflow fix
kaplun Mar 18, 2015
95c9ad9
BibIndex: soften author index HACK
kaplun Mar 20, 2015
b3abec0
OPS WebSearch: hack to workaround broken index
kaplun Mar 20, 2015
b360a74
Revert "OPS WebSearch: hack to workaround broken index"
kaplun Mar 23, 2015
5d3b707
BibIndex: author utf8 washing
kaplun Mar 24, 2015
59d1c44
BibRank: alternate patterns
kaplun Mar 25, 2015
8f61c7c
BibRank: reduce log output from searches
jalavik Apr 3, 2015
52f5546
OPS BibRank: Asana ticket for duplicates
kaplun Apr 28, 2015
e5afbef
OPS WebSearch: phrase journal index
kaplun Apr 28, 2015
5bf3649
OPS BibRank: Asana ticket improvement
kaplun Apr 28, 2015
74acf99
BibConvert: support ORCIDs in authorlist XSLT
jalavik May 13, 2015
2f08d9d
BatchUploader: holdingpen support
jmartinm May 15, 2015
57634db
BibIndex: BibIndexReferenceCountTokenizer
kaplun May 15, 2015
642e3c3
WebSearch: referencecount alias
kaplun May 15, 2015
e9c73bc
BibIndex: referencecount improvement
kaplun May 15, 2015
63ee2f0
dbquery: sleep between reconnection
kaplun May 15, 2015
58ecde3
OPS Amend tokenizer
kaplun May 15, 2015
3f39ffa
Bibauthorid: fix urllib.quote use on int
tsgit May 21, 2015
536ae52
BibConvert: authorlist conversion improvement
jalavik May 28, 2015
7b0408b
BibSched: do not send emergency on bibupload (OPS)
jalavik Mar 25, 2015
384bcf1
BibSched: emergency notification fix
jalavik Jun 2, 2015
67ce19c
OPS BibSched: no emergency fix
kaplun Jun 4, 2015
66c997e
OPS htmlutils: MathJax 2.5.x and CDN
kaplun Jun 5, 2015
1b30b27
OPS WebSearch: disable outdated warnings
kaplun Jun 8, 2015
395a8c2
OPS BibUpload: duplicate records in Asana
kaplun Jun 12, 2015
ff92a12
OPS BibUpload: improving previous message
kaplun Jun 12, 2015
8a2029a
BibCheck: no webcoll or bibindex
kaplun Jun 15, 2015
7614086
WebAccess: add missing runbibcheck action
kaplun Jun 15, 2015
d695318
BibRank: swap recids in Asana duplicate link
kaplun Jun 23, 2015
36f3ce4
MiscUtil: require texkey in subfield a
tsgit Jun 25, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
image: inspirehep/invenio-drone:latest
script:
# Autotools
- aclocal
- automake -a
- autoconf
- ./configure

# Create destination
- sudo mkdir -p /opt/invenio
- sudo chown drone:drone /opt/invenio
- mkdir -p /opt/invenio/lib/python/invenio
- sudo ln -s /opt/invenio/lib/python/invenio /usr/local/lib/python2.7/dist-packages/invenio

# Install
- make
- make install

# Config
- sed -i 's/www-data/drone/g' ~/invenio-local.conf
- mv ~/invenio-local.conf /opt/invenio/etc/invenio-local.conf
- /opt/invenio/bin/inveniocfg --update-all
- /opt/invenio/bin/inveniocfg --load-bibfield-conf

# Mails
- sudo service postfix start

# Apache
- /opt/invenio/bin/inveniocfg --create-apache-conf
- sed -i 's/WSGIDaemonProcess invenio/WSGIDaemonProcess invenio user=drone/g' /opt/invenio/etc/apache/invenio-apache-vhost.conf
- sed -i 's/WSGIDaemonProcess invenio/WSGIDaemonProcess invenio user=drone/g' /opt/invenio/etc/apache/invenio-apache-vhost-ssl.conf
- sudo ln -fs /opt/invenio/etc/apache/invenio-apache-vhost.conf /etc/apache2/sites-available/invenio.conf
- sudo ln -fs /opt/invenio/etc/apache/invenio-apache-vhost-ssl.conf /etc/apache2/sites-available/invenio-ssl.conf
- sudo /usr/sbin/a2ensite invenio
- sudo /usr/sbin/a2ensite invenio-ssl
- touch /opt/invenio/var/log/apache.err
- sudo chown www-data:www-data /opt/invenio/var/log/apache.err

# Redis
- sudo service redis-server start

# Database
- sudo mv /var/lib/mysql /dev/shm/mysql
- sudo ln -s /dev/shm/mysql /var/lib/mysql
- sudo service mysql start
- mysql -e "CREATE DATABASE invenio DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" -u root
- mysql -e "GRANT ALL PRIVILEGES ON invenio.* TO invenio@localhost IDENTIFIED BY 'my123p\$ss'" -u root

# Load records
- /opt/invenio/bin/inveniocfg --create-tables --yes-i-know
- /opt/invenio/bin/inveniocfg --create-demo-site --yes-i-know
- /opt/invenio/bin/inveniocfg --load-demo-records --yes-i-know

# Start apache after creating the demo site
# to be able to populate startup caches properly
- sudo service apache2 start

# Tests
- nosetests -v /opt/invenio/lib/python/invenio/*_unit_tests.py
- nosetests -v /opt/invenio/lib/python/invenio/*_regression_tests.py
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ python:

install:
- sudo apt-get update
- git clone https://github.com/tiborsimko/invenio-devscripts /tmp/invenio-devscripts
- git clone https://github.com/kaplun/invenio-devscripts /tmp/invenio-devscripts --branch no-pip-upgrade
- CFG_INVENIO_SRCDIR=$(pwd) /tmp/invenio-devscripts/invenio-kickstart --yes-i-know --yes-i-really-know

script:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXTRA_DIST = UNINSTALL THANKS RELEASE-NOTES configure-tests.py config.nice.in \

# current MathJax version and packages
# See also modules/miscutil/lib/htmlutils.py (get_mathjax_header)
MJV = 2.3
MJV = 2.5.3
MATHJAX = http://invenio-software.org/download/mathjax/MathJax-v$(MJV).zip

# current CKeditor version
Expand Down
72 changes: 59 additions & 13 deletions modules/bibauthorid/lib/bibauthorid.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,36 @@ var ticketbox = {
};
}(),

app: { debug: false }
app: { debug: true, hasFocus: false },

sureUpdate: function() {
var time = 1000;
var growth = 0.1;
var app = ticketbox.app;

var poller = function() {

var failure = function() {
time += time * growth;
window.setTimeout(poller, time);
app.debug && console.log("[SureUpdate] FAILED: Retrying in " + time/1000 + " seconds.");
};

var success = function() {
app.debug && console.log("[SureUpdate] Update succeeded after multiple attempts.");
};

if (app.hasFocus) {
app.userops.fetch({"on": 'user', "error": failure, "success": success});
}
};

return function(coll, resp, opt) {
window.setTimeout(poller, time);
};


}
};

/**
Expand Down Expand Up @@ -115,9 +144,17 @@ var ticketbox = {
params.data = {};
params.data.jsondata = Server.dataOn({}, options.on);

// Set success and error callbacks
var syncCallback = function(jqXHR, status) {
var sureUpdate = ticketbox.sureUpdate();
if (method != "read") {
app.userops.fetch({"on": 'user', "error": sureUpdate});
}
};

// Set AJAX callbacks
params.success = options.success;
params.error = options.error;
params.complete = syncCallback;

var generateRequest = function(type) {
var requestTypes = {
Expand All @@ -144,7 +181,7 @@ var ticketbox = {
app.debug && console.error("[Operation Model] ERROR: No request type defined.");
return {};
}
}
};

switch (method) {
case 'create':
Expand Down Expand Up @@ -344,7 +381,7 @@ var ticketbox = {

events: {
'click .removeOp': 'removeOperation',
'click select': 'bibrefSelected'
'change select': 'bibrefSelected'
},

initialize: function(){
Expand Down Expand Up @@ -1616,8 +1653,24 @@ jQuery(function($) {

disableLinks($("#person_menu").find("li.disabled"));

// Stupid polling
setInterval(function() { app.userops.fetch({"on": 'user'});}, 15000);
// Window focus event binding
var updater = (function() {
app.hasFocus = true;
$(window).focus(function(event) {
app.hasFocus = true;
var successFocus = function() {
app.debug && console.log("[Focus Update] Update succeeded.");
};

var sureUpdate = ticketbox.sureUpdate();
app.userops.fetch({"on": 'user', "error": sureUpdate, "success": successFocus});
app.debug && console.log("Focus update triggered.");
}).blur(function(event) {
app.hasFocus = false;
app.debug && console.log("Focus lost.");
});
})();


// // PidSearch test
// var searchModel = new PidSearch.SearchModel();
Expand All @@ -1627,13 +1680,6 @@ jQuery(function($) {
// app.search = searchModel;
// app.searchView = searchInterface;

console.log("Ticketing Loaded.");

var profilePageRegex = /\/author\/profile\//;
var profilePage = profilePageRegex.test(window.location.pathname);
if (profilePage) {
$("#bai_content").prepend("<div class='well'><h4>Welcome to the improved author profiles!</h4><p>We have revised our author page. Please let us know what you think via <a href='mailto:[email protected]?subject=Revised%20Author%20Profiles'>[email protected]</a></p></div>");
}

});

Expand Down
6 changes: 4 additions & 2 deletions modules/bibauthorid/lib/bibauthorid_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@
# Special for ADS: Focus on ASTRONOMY collection
if GLOBAL_CONFIG and CFG_ADS_SITE:
LIMIT_TO_COLLECTIONS = ["ASTRONOMY"]
else:
elif CFG_INSPIRE_SITE:
LIMIT_TO_COLLECTIONS = ['HEP']
else:
LIMIT_TO_COLLECTIONS = []

# Exclude documents that are visible in a collection mentioned here:
EXCLUDE_COLLECTIONS = ["HEPDATA","Data", "HEPNAMES", "INST", "Deleted", "DELETED", "deleted"]
Expand Down Expand Up @@ -171,7 +173,7 @@
# their use explicit.
DEBUG_CHECKS = False

TORTOISE_FILES_PATH = '/opt/tortoise_cache/'
TORTOISE_FILES_PATH = '/opt/invenio/var/cache/bibauthorid/tortoise_cache'

# force skip ui arxiv stub page (specific for inspire)
BIBAUTHORID_UI_SKIP_ARXIV_STUB_PAGE = True
Expand Down
20 changes: 14 additions & 6 deletions modules/bibauthorid/lib/bibauthorid_dbinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ def get_author_info_of_confirmed_paper(sig): ### personid_name_from_signature
and flag > -2""",
sig )

assert len(conf_author) < 2, "More that one author hold the same signature: %s" % conf_author
assert len(conf_author) < 2, "More than one author hold the same signature: %s" % str(conf_author)

return conf_author

Expand Down Expand Up @@ -1128,7 +1128,7 @@ def get_authors_by_name_regexp(name_regexp): ### get_all_personids_by_name
(name_regexp,) )


def get_authors_by_name(name): ### find_pids_by_exact_name
def get_authors_by_name(name, limit_to_recid=False): ### find_pids_by_exact_name
'''
Gets all authors who have records with the specified name.

Expand All @@ -1138,8 +1138,14 @@ def get_authors_by_name(name): ### find_pids_by_exact_name
@return: author identifiers
@rtype: set set((int),)
'''
return set(_select_from_aidpersonidpapers_where(select=['personid'], name=name))

if limit_to_recid:
pids = run_sql("select personid from aidPERSONIDPAPERS where name=%s and bibrec=%s and flag>-2",
(name, limit_to_recid))
return set(pids)
else:
pids = run_sql("select personid from aidPERSONIDPAPERS where name=%s and flag>-2",
(name,))
return set(pids)

def get_paper_to_author_and_status_mapping(): ### get_bibrefrec_to_pid_flag_mapping
'''
Expand Down Expand Up @@ -2696,12 +2702,12 @@ def get_papers_affected_since(since): ### personid_get_recids_affected_since
'''
recs = set(_split_signature_string(sig[0])[2] for sig in run_sql("""select distinct value
from aidUSERINPUTLOG
where timestamp > %s""",
where timestamp >= %s""",
(since,) ) if ',' in sig[0] and ':' in sig[0])

pids = set(int(pid[0]) for pid in run_sql("""select distinct personid
from aidUSERINPUTLOG
where timestamp > %s""",
where timestamp >= %s""",
(since,) ) if pid[0] > 0)

if pids:
Expand Down Expand Up @@ -4124,6 +4130,8 @@ def get_all_valid_papers(): ### get_all_valid_bibrecs
@return: paper identifiers
@rtype: list [int,]
'''
if not bconfig.LIMIT_TO_COLLECTIONS:
return perform_request_search(p="")
collection_restriction_pattern = " or ".join(["980__a:\"%s\"" % x for x in bconfig.LIMIT_TO_COLLECTIONS])

return perform_request_search(p="%s" % collection_restriction_pattern, rg=0)
Expand Down
21 changes: 18 additions & 3 deletions modules/bibauthorid/lib/bibauthorid_general_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
except ImportError:
from xml.etree import ElementTree as ET
from urllib import urlopen
from urllib2 import HTTPError
from collections import deque

import multiprocessing as mp
Expand All @@ -48,6 +47,9 @@
if NEWLINE or FO:
TERMINATOR = '\n'

import socket
from urllib2 import URLError

import os
PID = os.getpid

Expand Down Expand Up @@ -247,8 +249,14 @@ def is_arxiv_id_or_doi(identifier):
def get_title_of_doi(doi):
try:
xml = get_marcxml_for_doi(doi)
except CrossrefError:
except (CrossrefError, socket.timeout):
return doi
except URLError, e:
# For python 2.6 socket.timeout cannot be caught directly
if hasattr(e, "reason") and isinstance(e.reason, socket.timeout):
return doi
else: # We make sure we don't cut out other URLErrors.
raise

root = ET.fromstring(xml)

Expand Down Expand Up @@ -302,7 +310,14 @@ def get_title_from_arxiv_xml(tree, tags):
xml = fxml.read()
fxml.close()
root = ET.fromstring(xml)
except HTTPError:
except URLError, e:
# For python 2.6 socket.timeout cannot be caught directly
if hasattr(e, "reason") and isinstance(e.reason, socket.timeout):
return arxiv_pubid
else: # We make sure we don't cut out other URLErrors.
raise
except socket.timeout:
# Python 2.7
return arxiv_pubid

title = get_title_from_arxiv_xml(root, deque(['GetRecord', 'record', 'metadata', 'dc', 'title']))
Expand Down
2 changes: 1 addition & 1 deletion modules/bibauthorid/lib/bibauthorid_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2813,7 +2813,7 @@ def tmpl_update_hep_name(self, full_name, display_name, email,
<TD><span class="span_float_left"><TEXTAREA NAME=Abstract ROWS=3 COLS=30></textarea><FONT SIZE=2>(not displayed)</FONT></span></TD></TR>
<tr><TD> <span class="span_float_right"><font size="1">SPAM Robots have been sending us submissions via this form, in order to prevent this we ask that you confirm that you are a real person by answering this question, which should be
easy for you, and hard for a SPAM robot. Cutting down on the extraneous submissions we get means that we can handle real requests faster.</font></span></td><td><span class="span_float_left">
<script type="text/javascript" src="http://www.slac.stanford.edu/spires/hepnames/spbeat.js">
<script type="text/javascript" src="https://www.slac.stanford.edu/spires/hepnames/spbeat.js">
</SCRIPT><br /><STRONG> How many people in image</STRONG> <SELECT NAME=beatspam ID=beatspam> <OPTION VALUE=""> </OPTION>
<option value="1"> one person</option>
<option value="2"> two people</option><option value="3"> three people</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from invenio.bibauthorid_webapi import get_papers_by_person_id #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_dbinterface import get_names_of_author #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_dbinterface import get_existing_authors #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_dbinterface import get_authors_by_name #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_frontinterface import get_confirmed_papers_of_author #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_dbinterface import get_title_of_paper #emitting #pylint: disable-msg=W0611
from invenio.bibauthorid_dbinterface import get_orcid_id_of_author #emitting #pylint: disable-msg=W0611
Expand Down
Loading