Aide, Keyerror avec Python Brisa
Bonjour,
Je suis entain de travailler sur la création d'une plate forme UPnP AV / DLNA.
Je travail sous Ubuntu 11.10 et Python 2.7.
J'essaye actuellement d'utiliser le code de Python Brisa lien : http://brisa.garage.maemo.org/
Avec le tutorial suivant : http://www.linux-magazine.com/Issues...-Plug-and-Play
Afin de réaliser un Control Point AV pilotable par ligne de commande.
Mais j'ai une erreur à lors l'utilisation de ce programme :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
Traceback (most recent call last):
File "CommandlLineControlPointAv.py", line 93, in <module>
main()
File "CommandlLineControlPointAv.py", line 89, in main
cmdline.run()
File "CommandlLineControlPointAv.py", line 68, in run
self.cmd_browse(c.split(' ')[1])
File "CommandlLineControlPointAv.py", line 48, in cmd_browse
resultat = self.browse(id, 'BrowseDirectChildren', '*', 0, 10)['Result']
File "/usr/local/lib/python2.7/dist-packages/brisa/upnp/control_point/control_point_av.py", line 137, in browse
elt = Element.from_string(browse_response['Result'])
KeyError: 'Result' |
La partie de code est la suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
def browse(self, object_id, browse_flag, filter, starting_index,
requested_count, sort_criteria="dc:title"):
""" Browses media servers.
@param object_id: object id
@param browse_flag: BrowseDirectChildren or BrowseMetadata
@param filter: a filter to indicate which metadata properties
are to be returned. Usually "*".
@param starting_index: starting index to consider the requested count
@param requested_count: requested number of entries
@param sort_criteria: sorting criteria
@type object_id: string
@type browse_flag: string
@type filter: string
@type starting_index: int
@type requested_count: int
@type sort_criteria: string
@return: a list of containers and items
@rtype: list
"""
service = self.get_cd_service()
browse_response = service.Browse(ObjectID=str(object_id),
BrowseFlag=browse_flag,
Filter=filter,
StartingIndex=starting_index,
RequestedCount=requested_count,
SortCriteria=sort_criteria)
elt = Element.from_string(browse_response['Result'])
browse_response['Result'] = elt.get_items()
return browse_response |
Qu'elle peut être la cause de cette erreur?
Et qu'elle serait la solution pour l'éviter?
Merci d'avance
Rémi