msgcollection.py 889 Bytes
Newer Older
1 2 3 4 5 6 7
""" harvest_tools.msgcollection

"""
from gluon.storage import Storage


class MsgCollection(Storage):
8 9 10
    """Messages for a collection.

    Args:
LE GAC Renaud's avatar
LE GAC Renaud committed
11 12 13 14 15 16 17 18 19 20 21
        error (unicode):
            error when scanning the collection.

        found (int):
            number of publication found in the harvester repository.

        url (unicode):
            URL used to scan the harvester repository.

        title (unicode):
            title of the collection.
22 23 24 25 26 27 28 29 30 31 32

    """
    def __init__(self, error="", found=0, title="", url=""):
        Storage.__init__(self)
        self.error = error
        self.found = found
        self.title = title
        self.url = url

    def url_hb(self):
        """
33
        Returns:
LE GAC Renaud's avatar
LE GAC Renaud committed
34 35 36
            str:
                an URL configures to return a list of record
                sin readable format.
37 38 39

        """
        return self.url.replace("of=id", "of=hb")