def test_no_overwrite(self):
     try:
         update_references(92, overwrite=False)
         self.fail()
     except RecordHasReferences:
         # As expected
         pass
 def test_no_overwrite(self):
     try:
         update_references(92, overwrite=False)
         self.fail()
     except RecordHasReferences:
         # As expected
         pass
 def test_no_fulltext(self):
     try:
         update_references(2000000)
         self.fail()
     except FullTextNotAvailable:
         # As expected
         pass
 def test_no_fulltext(self):
     try:
         update_references(2000000)
         self.fail()
     except FullTextNotAvailable:
         # As expected
         pass
 def test_no_overwrite(self):
     from invenio.refextract_api import RecordHasReferences, \
         update_references
     try:
         update_references(92, overwrite=False)
         self.fail()
     except RecordHasReferences:
         # As expected
         pass
 def test_no_fulltext(self):
     from invenio.refextract_api import FullTextNotAvailable, \
         update_references
     try:
         update_references(1000000000000)
         self.fail()
     except FullTextNotAvailable:
         # As expected
         pass
示例#7
0
def task_run_core(recid, bibcatalog_system=None, _arxiv=False):
    if _arxiv:
        overwrite = True
    else:
        overwrite = not task_get_option("no-overwrite")

    try:
        update_references(recid, overwrite=overwrite)
        msg = "Extracted references for %s" % recid
        if overwrite:
            write_message("%s (overwrite)" % msg)
        else:
            write_message(msg)

        # Create a RT ticket if necessary
        if not _arxiv and task_get_option("new") or task_get_option("create-ticket"):
            write_message("Checking if we should create a ticket", verbose=1)
            create_ticket(recid, bibcatalog_system)
    except FullTextNotAvailable:
        write_message("No full text available for %s" % recid)
    except RecordHasReferences:
        write_message("Record %s has references, skipping" % recid)
示例#8
0
def task_run_core(recid, bibcatalog_system=None, _arxiv=False):
    if _arxiv:
        overwrite = True
    else:
        overwrite = not task_get_option('no-overwrite')

    try:
        update_references(recid, overwrite=overwrite)
        msg = "Extracted references for %s" % recid
        if overwrite:
            write_message("%s (overwrite)" % msg)
        else:
            write_message(msg)

        # Create a RT ticket if necessary
        if not _arxiv and task_get_option('new') \
                                    or task_get_option('create-ticket'):
            write_message("Checking if we should create a ticket", verbose=1)
            create_ticket(recid, bibcatalog_system)
    except FullTextNotAvailable:
        write_message("No full text available for %s" % recid)
    except RecordHasReferences:
        write_message("Record %s has references, skipping" % recid)