Comment 1 for bug 474114

Revision history for this message
Efrain Valles (effie-jayx) wrote :

This bug requires restructuring of the data for tems to acomodate the mugshot, there is no hotlinking from launchpad the lauchpad api's serve the binary file to be open. this suggests that we should import the files just as we do with the rest of the data.

taken from the API reference for launchpad. https://help.launchpad.net/API/launchpadlib

Hosted files

Launchpad stores some data in the form of binary files. A good example is peoples' mugshots. With launchpadlib, you can read and write these binary files programatically.

If you have a launchpadlib reference to one of these hosted files, you can read its data by calling the open() method and treating the result as an open filehandle.

    mugshot = launchpad.me.mugshot
    mugshot_handle = mugshot.open()
    mugshot_handle.read()
    # [binary data]
    mugshot_handle.content_type
    # 'image/jpeg'
    mugshot_handle.last_modified
    # 'Wed, 12 Mar 2008 21:47:05 GMT'

Cna you think of a workaround for this?