Commit 659afc2c authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update Msg and Automaton to add origin attribut

parent dc5f3080
...@@ -11,6 +11,7 @@ from .msg import Msg ...@@ -11,6 +11,7 @@ from .msg import Msg
from .msgcollection import MsgCollection from .msgcollection import MsgCollection
from plugin_dbui import CALLBACK_ERRORS, get_id from plugin_dbui import CALLBACK_ERRORS, get_id
from store_tools import (build_store, from store_tools import (build_store,
OAI,
OAI_URL, OAI_URL,
StoreException, StoreException,
ToolException) ToolException)
...@@ -477,6 +478,7 @@ class Automaton(object): ...@@ -477,6 +478,7 @@ class Automaton(object):
# start the log for the record # start the log for the record
logs.append(Msg(harvester=harvester, logs.append(Msg(harvester=harvester,
collection=collection_logs[-1].title, collection=collection_logs[-1].title,
origin=record.oai(),
record_id=record.id(), record_id=record.id(),
title=record.title())) title=record.title()))
...@@ -535,6 +537,7 @@ class Automaton(object): ...@@ -535,6 +537,7 @@ class Automaton(object):
url = OAI_URL % (harvester.host, rec_id) url = OAI_URL % (harvester.host, rec_id)
logs.append(Msg(harvester=harvester, logs.append(Msg(harvester=harvester,
collection=collection_logs[-1].title, collection=collection_logs[-1].title,
origin=OAI % (harvester.host, rec_id),
record_id=rec_id, record_id=rec_id,
title=url)) title=url))
logs[-1].reject(e) logs[-1].reject(e)
......
...@@ -29,6 +29,9 @@ class Msg(Storage): ...@@ -29,6 +29,9 @@ class Msg(Storage):
harvester (gluon.dal.Row): harvester (gluon.dal.Row):
the database harvester used to scan the store. the database harvester used to scan the store.
origin (str):
identify store(s) housing the publication
record_id (int): record_id (int):
the record identifier in the store. the record identifier in the store.
...@@ -40,6 +43,7 @@ class Msg(Storage): ...@@ -40,6 +43,7 @@ class Msg(Storage):
def __init__(self, def __init__(self,
collection=None, collection=None,
harvester=None, harvester=None,
origin=None,
record_id=None, record_id=None,
title=None): title=None):
...@@ -51,6 +55,7 @@ class Msg(Storage): ...@@ -51,6 +55,7 @@ class Msg(Storage):
else: else:
self.harvester = json.dumps(harvester.as_dict()) self.harvester = json.dumps(harvester.as_dict())
self.origin = origin
self.record_id = record_id self.record_id = record_id
self.synonym = None self.synonym = None
self.title = title self.title = title
......
...@@ -18,6 +18,7 @@ from .base import (ARXIV, ...@@ -18,6 +18,7 @@ from .base import (ARXIV,
MSG_TOOMANY_SYNONYM, MSG_TOOMANY_SYNONYM,
MSG_UNKNOWN_COLLABORATION, MSG_UNKNOWN_COLLABORATION,
MSG_WELL_FORMED_COLLABORATION, MSG_WELL_FORMED_COLLABORATION,
OAI,
OAI_URL, OAI_URL,
REG_ARXIV_NUMBER, REG_ARXIV_NUMBER,
REG_AUTHOR, REG_AUTHOR,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment