Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/parsers.py
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
class SWHAtomEntryParser(SWHXMLParser): | class SWHAtomEntryParser(SWHXMLParser): | ||||
"""Atom entry parser limited to specific mediatype | """Atom entry parser limited to specific mediatype | ||||
""" | """ | ||||
media_type = 'application/atom+xml;type=entry' | media_type = 'application/atom+xml;type=entry' | ||||
def parse(self, stream, media_type=None, parser_context=None): | |||||
# We do not actually want to parse the stream yet | |||||
# because we want to keep the raw data as well | |||||
# this is done later in the atom entry call | |||||
# (cf. swh.deposit.api.common.SWHBaseDeposit._atom_entry) | |||||
return stream | |||||
class SWHMultiPartParser(MultiPartParser): | class SWHMultiPartParser(MultiPartParser): | ||||
"""Multipart parser limited to a subset of mediatypes. | """Multipart parser limited to a subset of mediatypes. | ||||
""" | """ | ||||
media_type = 'multipart/*; *' | media_type = 'multipart/*; *' | ||||
Show All 11 Lines |