Discussion:
[Bitpim-devel] Stuck on media upload coding
Stephen Wood
2004-05-26 03:37:08 UTC
Permalink
I am trying to do media upload and am stuck trying to understand
something.

I have this method:

def savewallpapers(self, results, merge):
return self.savemedia('wallpapers', 'wallpaper-index', results)

And a savemedia the starts:

def savemedia(self, mediakey, mediaindexkey, results):
wp=results[mediakey].copy()
wpi=results[mediaindexkey].copy()

If I print wp, it contains origin, data, and name for each wallpaper.
But wpi, is empty. If I put print statements elsewhere in bitpim,
wallpaper-index is non-empty in the dictionary, but by the time it gets
to savewallpapers, it's empty.

Does the wallpaper-index get filtered somewhere. I have set
WALLPAPER_WIDTH, HEIGHT, to 96x96 and WALLPAPER_CONVERT_FORMAT to bmp,
matching at least some of the wallpapers I have in my bitpim files
directory.

Any thoughts?
Stephen
Roger Binns
2004-05-26 08:19:17 UTC
Permalink
Post by Stephen Wood
Does the wallpaper-index get filtered somewhere.
No. You do need to add it though. The dictionary starts out
empty, and is filled by calls to the getdata() method of the
various widgets (phonebook, calendar, wallpaper etc), and is
then further filled in by getfundamentals() with whatever you
want.

For the wallpaper-index, you should fill that in getfundamentals()
if you need one later. (The wallpaper-index is supposed to reflect
what is on the phone, not what BitPim has stored on disk).
Post by Stephen Wood
I have set
WALLPAPER_WIDTH, HEIGHT, to 96x96 and WALLPAPER_CONVERT_FORMAT to bmp,
matching at least some of the wallpapers I have in my bitpim files
directory.
Those variables only affect what happens when an image is added to
the wallpaper tab.

Roger
Stephen Wood
2004-05-26 16:34:47 UTC
Permalink
On Wed, 2004-05-26 at 04:19, Roger Binns wrote:
...
Post by Roger Binns
For the wallpaper-index, you should fill that in getfundamentals()
if you need one later. (The wallpaper-index is supposed to reflect
what is on the phone, not what BitPim has stored on disk).
Well, that explains it. The phone that I am working with has no builtin
wallpaper, and while medias can be written to the phone, there is no
known way to read what media has been sent to the phone. (Reminds me
ofhttp://www.microsym.com/25120_WOM.pdf) Now I know what to do about
wallpaper-index (ignore it). It will become relevant as I go onto other
phones.

Stephen

Loading...