Discussion:
[Bitpim-devel] Test 12 and Sanyo 8100
Jeff Elkins
2004-06-04 14:12:36 UTC
Permalink
Howdy, Roger suggested I join the dev list and post this...

I'm running a copy of test12 from CVS under debian sid, using a sanyo 8100.
I've discovered that ringers import from the phone but .qcp files are not
written to the index.idx file, just .mid files.

For me, this is reproduceable every time. Simply have both .mid and .qcp
ringers on the phone and do a get phone data.

I'm hacking around in the code, but am a python newbie. I know no one has time
for handholding, but if someone could point me to the source that builds the
ringer index.idx files, I'd be happy to see if I can fix it.

Jeff Elkins
Stephen Wood
2004-06-04 16:40:52 UTC
Permalink
Post by Jeff Elkins
Howdy, Roger suggested I join the dev list and post this...
I'm running a copy of test12 from CVS under debian sid, using a sanyo 8100.
I've discovered that ringers import from the phone but .qcp files are not
written to the index.idx file, just .mid files.
Jeff:

I am not too familiar with the code where the ringer data is managed,
which is in ringers.py. But it would be worth checking that the Sanyo
code is doing what it is supposed to. A few print statements in in
com_sanyomedia.py will help to know if the code actually transfers the
qcp files and if they are put into an index.



In the routine getmediaindices, after

for ext in self.ringerexts:
if fname.endswith(ext):

put print idx,res.filename

That will print on terminal where you started bitpim from. Let me know
if you see the qcp filenames being printed.

Also in getmedia, there is a line "self.log("Retrieving file:
"+filename)". That should write a note to the log panel for each file
read. Do you see the qcp files showing up there?

Stephen

P.S. Ignore the routine getmediaindex. That is some older test code
that is not used and that I should really remove.
Jeff Elkins
2004-06-04 18:17:09 UTC
Permalink
Post by Stephen Wood
put print idx,res.filename
That will print on terminal where you started bitpim from. Let me know
if you see the qcp filenames being printed.
No, qcp filenames aren't printed. .mid files are.
Post by Stephen Wood
"+filename)". That should write a note to the log panel for each file
read. Do you see the qcp files showing up there?
Yes. The log shows them being transferred, and indeed they are.

Also in com_sanyomedia.py:

ringerexts=(".mid", ".qcp")

Just for chuckles, I reversed mid and qcp in the statement above:

ringerexts=(".qcp", ".mid")

, and lo: qcp files were written to index.idx! --- but .mid files weren't :)
Also, in the print statement added earlier, .qcp files show up rather than
mid.

So, somehow the second element of the ringerexts array isn't being read?

Jeff
Stephen Wood
2004-06-04 19:16:05 UTC
Permalink
On Fri, 2004-06-04 at 14:17, Jeff Elkins wrote:
...
Post by Jeff Elkins
ringerexts=(".qcp", ".mid")
Well that looks like the key clue.

I stared at the code again. It looks like the "break" line just after
the "ringermedia[idx]=..." line needs to be indented by another 4
spaces. So the code will look like:

for ext in self.ringerexts:
if fname.endswith(ext):
ringermedia[idx]={'name': res.filename, 'origin': "ringers"}
break

I have checked this fix into the CVS. Thanks for helping to track this down.

Stephen
Jeff Elkins
2004-06-04 20:26:33 UTC
Permalink
Post by Stephen Wood
...
Post by Jeff Elkins
ringerexts=(".qcp", ".mid")
Well that looks like the key clue.
I stared at the code again. It looks like the "break" line just after
the "ringermedia[idx]=..." line needs to be indented by another 4
ringermedia[idx]={'name': res.filename,
'origin': "ringers"} break
I have checked this fix into the CVS. Thanks for helping to track this down.
Stephen
The cvs copy didn't work for me. It looks like the indent edit didn't make
into cvs. The fix works, I edited my local com_sanyomedia.py file to test.
It's attached as jeff.py. The current cvs copy is attached as cvs_py.py

Jeff

Jeff
Roger Binns
2004-06-05 00:58:45 UTC
Permalink
Are the filenames all lower case? If not I would assume you need
fname.lower().endswith(ext) instead.

Roger

Loading...