Part of elisa.plugins.daap.daap_parser View In Hierarchy
Line # | Kind | Name | Docs |
---|---|---|---|
57 | Method | __init__ | Undocumented |
65 | Method | parse_chunk | unpack one chunk of data and decode the value, if it is not a container. |
89 | Method | simple_parse | Parse the full data simple into a dictionary with key:value. This is |
108 | Method | parse_mdcl | parse *one* mdcl entry and return the three values (decoded) |
125 | Method | parse_to_model | Undocumented |
130 | Method | _parse_to_model | Parse the given chunk of data into the given model by using the |
208 | Method | _decode | Undocumented |
Parameters | data | the data to read
(type: str
) |
Returns | the code_name, the (decoded) value and the rest of the data
(type: tuple containing 3 strings
) | |
Raises | NotEnoughData | if the size for value is longer than the rest of the data that is left |
Parameters | data | the full data to read
(type: str
) |
Returns | code mapped to the value
(type: dict
) |
Returns | mcna, mcnm, mcty
(type: tuple
) |
Parse the given chunk of data into the given model by using the models.mappings, model.container and model.container_items.
This is a very complex method you could use to parse any given chunk of data you get over a http request to the given model. It is also able to find listitems and parse the values. It then wraps the values into a new createdmodel.container_items
Model by calling the same method
with the value and the model again. After wards it appends it to the list
specified in model.container.
Parameters | data | the chunk of data to parse into the model
(type: str
) |
model | The Model to parse it into
(type: elisa.plugins.daap.models.DaapModel
) | |
Returns | the tail of the data it was not able to parse in case it's missing some
data to be able to unpack it. You should keep this data and reuse it for a
new request, when you have more data.
(type: str
) | |
Raises | NotImplementedError | when a container is found but the given model doesn't support containers. |