Discussion:
[Bitpim-devel] Samsung SCH-A650 and A310 Support
d***@netzero.com
2004-10-26 03:01:28 UTC
Permalink
BITPIM supports for Samsung SCH-A650 and SCH-A310 phones are now available for testing. Supported features include phonebook and calendar. The main modules include com_samsung, com_samsungscha650, and com_samsungscha310. Changes in module guiwidgets add operator selections of A650 and A310 to the dialog box. Module com_samsung currently does not use commport.sendatcommand pending final testing from Stephen. Please post any bugs you may find as well as any comments, suggestions, or questions.

Thanks,

-Joe Pham
Stephen Wood
2004-10-27 03:52:02 UTC
Permalink
These updates along with some of my edits have been checked into the
CVS. As usual, the public CVS will take some time to update.
guiwidgets was the last thing edited, so if it containst the a310, a650
and a670, then everything else should be up to date.

Please let me know if things work after my updates.

Joe, the way that you split AT responses won't work for names with comas
in them. Also, you should check how your phones escape "'s. I deal
with these things in cvsplit which can be found in com_samsung.py.

Stephen
Post by d***@netzero.com
BITPIM supports for Samsung SCH-A650 and SCH-A310 phones are now
available for testing. Supported features include phonebook and
calendar. The main modules include com_samsung, com_samsungscha650,
and com_samsungscha310. Changes in module guiwidgets add operator
selections of A650 and A310 to the dialog box. Module com_samsung
currently does not use commport.sendatcommand pending final testing
from Stephen. Please post any bugs you may find as well as any
comments, suggestions, or questions.
Thanks,
-Joe Pham
Vic Heintz
2004-10-27 13:46:44 UTC
Permalink
Post by Stephen Wood
Joe, the way that you split AT responses won't work for names with
comas
in them. Also, you should check how your phones escape "'s. I deal
with these things in cvsplit which can be found in com_samsung.py.
I put an explicit comma in a name and did an AT#PBOKR and didn't see
any obvious evidence of escaping in my Kermit window. I can see how
Joe's code will fail, however.

As of now I have been reverting to Joe's com_samsung.py and my original
com_samsungscha670.py because I have been unable to get what is in cvs
to work. I haven't taken the time yet to investigate what is failing.

I also have issues with how the count of phonebook entries is obtained.
I will bring this up in a new thread.

Vic
Stephen Wood
2004-10-27 14:53:59 UTC
Permalink
Post by Vic Heintz
Post by Stephen Wood
Joe, the way that you split AT responses won't work for names with
comas
in them. Also, you should check how your phones escape "'s. I deal
with these things in cvsplit which can be found in com_samsung.py.
I put an explicit comma in a name and did an AT#PBOKR and didn't see
any obvious evidence of escaping in my Kermit window. I can see how
Joe's code will fail, however.
The coma does not get escaped by the phone. But unless the parsing
algorithm pays attention to the quotes, it will cause the items to be
split up wrong. I think the only things that are escaped are "
(replaced by }\002) and } (replaced by }]).
Post by Vic Heintz
As of now I have been reverting to Joe's com_samsung.py and my original
com_samsungscha670.py because I have been unable to get what is in cvs
to work. I haven't taken the time yet to investigate what is failing.
If you get a chance, send me whatever exception you get and a protocol
log. Make sure that you have updated cvs today.

Thanks, Stephen
Vic Heintz
2004-10-27 21:30:29 UTC
Permalink
Post by Stephen Wood
If you get a chance, send me whatever exception you get and a protocol
log. Make sure that you have updated cvs today.
I did this and Stephen's suggestion was to replace all instances of
"except ATError:" with "error:"
I did this and got past the initial problems BUT ended up in an endless
loop inside this routine in which j grows without bounds beyond the
actual number of entries:

def _get_phonebook(self, result, show_progress=True):
"""Reads the phonebook data. The L{getfundamentals}
information will
already be in result."""

self.pmode_on()
c=self._get_phone_num_count()
k,j=0,1
i=[0]
pb_book={}
while i[0]<c :
# print "Getting entry: ", j
##### Start Vic's emergency bail-out-of-endless-loop lines
if j > c:
self.log("Something went wrong")
break
##### End Vic's emergency bail-out-of-endless-loop lines
pb_entry=self.get_phone_entry(j);
if len(pb_entry):
pb_book[k]=self._extract_phone_entry(pb_entry, result,
i)
# print pb_book[k], i
if show_progress:
self.progress(i[0], c, 'Reading
'+pb_entry[self.__pb_name])
k+=1
j+=1
self.pmode_off()

return pb_book

I don't fully understand what is going on here but there is apparently
an error in logic. Any ideas Joe?

Vic
d***@netzero.com
2004-10-27 23:03:17 UTC
Permalink
Vic,

What's happening is get_phone_entry always got a valid phonebook entry and kept trying to read for more. Replace the line of

while i[0]<c:

with

while i[0]<c and j<501:

then you'd not be in an endless loop. The problem appears to be that commport.sendatcommand always sends back a blank response (at least when I looked at it initially). Will look more into it and let you know.

-Joe Pham
Post by Stephen Wood
If you get a chance, send me whatever exception you get and a protocol
log. Make sure that you have updated cvs today.
I did this and Stephen's suggestion was to replace all instances of
"except ATError:" with "error:"
I did this and got past the initial problems BUT ended up in an endless
loop inside this routine in which j grows without bounds beyond the
actual number of entries:

def _get_phonebook(self, result, show_progress=True):
"""Reads the phonebook data. The L{getfundamentals}
information will
already be in result."""

self.pmode_on()
c=self._get_phone_num_count()
k,j=0,1
i=[0]
pb_book={}
while i[0]<c :
# print "Getting entry: ", j
##### Start Vic's emergency bail-out-of-endless-loop lines
if j > c:
self.log("Something went wrong")
break
##### End Vic's emergency bail-out-of-endless-loop lines
pb_entry=self.get_phone_entry(j);
if len(pb_entry):
pb_book[k]=self._extract_phone_entry(pb_entry, result,
i)
# print pb_book[k], i
if show_progress:
self.progress(i[0], c, 'Reading
'+pb_entry[self.__pb_name])
k+=1
j+=1
self.pmode_off()

return pb_book

I don't fully understand what is going on here but there is apparently
an error in logic. Any ideas Joe?

Vic



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Vic Heintz
2004-10-28 10:51:17 UTC
Permalink
What I'm finding is that get_phone_entry is always returning [] and so
len(pb_entry) is always 0 - Vic
Post by d***@netzero.com
Vic,
What's happening is get_phone_entry always got a valid phonebook entry
and kept trying to read for more. Replace the line of
with
then you'd not be in an endless loop. The problem appears to be that
commport.sendatcommand always sends back a blank response (at least
when I looked at it initially). Will look more into it and let you
know.
-Joe Pham
Post by Stephen Wood
If you get a chance, send me whatever exception you get and a protocol
log. Make sure that you have updated cvs today.
I did this and Stephen's suggestion was to replace all instances of
"except ATError:" with "error:"
I did this and got past the initial problems BUT ended up in an endless
loop inside this routine in which j grows without bounds beyond the
"""Reads the phonebook data. The L{getfundamentals}
information will
already be in result."""
self.pmode_on()
c=self._get_phone_num_count()
k,j=0,1
i=[0]
pb_book={}
# print "Getting entry: ", j
##### Start Vic's emergency bail-out-of-endless-loop lines
self.log("Something went wrong")
break
##### End Vic's emergency bail-out-of-endless-loop lines
pb_entry=self.get_phone_entry(j);
pb_book[k]=self._extract_phone_entry(pb_entry, result,
i)
# print pb_book[k], i
self.progress(i[0], c, 'Reading
'+pb_entry[self.__pb_name])
k+=1
j+=1
self.pmode_off()
return pb_book
I don't fully understand what is going on here but there is apparently
an error in logic. Any ideas Joe?
Vic
-------------------------------------------------------
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up
today!
-------------------------------------------------------
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Vic Heintz
2004-10-28 12:00:11 UTC
Permalink
Post by Vic Heintz
What I'm finding is that get_phone_entry is always returning [] and so
len(pb_entry) is always 0 - Vic
Digging further I put a print statement in routine get_phone entry:

s=self.comm.sendatcommand("#PBOKR=%d" % entry_index)
print s
I get things like:

['#PBOKR: 40,10,0,0,"Dummy
entry",2,0,2345678901,0,4567890123,0,3216549870,0,5678912304,0,678901234
5,0,Adjg1bjk,0,,,"Eedjljmm",5,0,"",20041027T233952']

And the line
return split(split(s, ": ")[1], ",")

always returns [] for this.

I'm a python novice but shouldn't "s" be getting just the string from
the POBKR command? Doesn't [] indicate an array? What's with the single
quotes surrounding the string inside the brackets?

Vic
Stephen Wood
2004-10-28 13:28:22 UTC
Permalink
Post by Vic Heintz
And the line
return split(split(s, ": ")[1], ",")
always returns [] for this.
The s on this line should be s[0]. I committed this change.

Stephen
d***@netzero.com
2004-10-28 12:25:38 UTC
Permalink
Vic, thanks for the info. Based on what you posted, get_phone_entry won't work because it's looking for the subtring '\r\bOK\r\n' in the return before it processes the return. It appears that the OK substring has been stripped from the returns from commport.sendatcommand. I will need to update com_samsung to account for this. Stay tune.

-Joe Pham
Post by Vic Heintz
What I'm finding is that get_phone_entry is always returning [] and so
len(pb_entry) is always 0 - Vic
Digging further I put a print statement in routine get_phone entry:

s=self.comm.sendatcommand("#PBOKR=%d" % entry_index)
print s
I get things like:

['#PBOKR: 40,10,0,0,"Dummy
entry",2,0,2345678901,0,4567890123,0,3216549870,0,5678912304,0,678901234
5,0,Adjg1bjk,0,,,"Eedjljmm",5,0,"",20041027T233952']

And the line
return split(split(s, ": ")[1], ",")

always returns [] for this.

I'm a python novice but shouldn't "s" be getting just the string from
the POBKR command? Doesn't [] indicate an array? What's with the single
quotes surrounding the string inside the brackets?

Vic



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
d***@netzero.com
2004-10-28 13:01:36 UTC
Permalink
Never mind, I was looking at the old code.

-- "***@netzero.com" <***@netzero.com> wrote:

Vic, thanks for the info. Based on what you posted, get_phone_entry won't work because it's looking for the subtring '\r\bOK\r\n' in the return before it processes the return. It appears that the OK substring has been stripped from the returns from commport.sendatcommand. I will need to update com_samsung to account for this. Stay tune.

-Joe Pham
Post by Vic Heintz
What I'm finding is that get_phone_entry is always returning [] and so
len(pb_entry) is always 0 - Vic
Digging further I put a print statement in routine get_phone entry:

s=self.comm.sendatcommand("#PBOKR=%d" % entry_index)
print s
I get things like:

['#PBOKR: 40,10,0,0,"Dummy
entry",2,0,2345678901,0,4567890123,0,3216549870,0,5678912304,0,678901234
5,0,Adjg1bjk,0,,,"Eedjljmm",5,0,"",20041027T233952']

And the line
return split(split(s, ": ")[1], ",")

always returns [] for this.

I'm a python novice but shouldn't "s" be getting just the string from
the POBKR command? Doesn't [] indicate an array? What's with the single
quotes surrounding the string inside the brackets?

Vic



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Vic Heintz
2004-10-29 17:43:52 UTC
Permalink
Now that calendar functionality is working for my phone I discovered a
very annoying gui issue when running bitpim via python on Mac OS X
Jaguar. The Start and End boxes have a background color of BLACK making
it impossible to see the date and time adjustment fields inside. Only
by fishing around and double-clicking do they become black on grey so
you can see them to overtype what is there.

While I'm on the subject I will reiterate a less significant annoyance
with the gui that I reported some time ago. Without fail when I first
start bitpim up all tabs to the right of "Phonebook" seem to be hidden
by a ghost rectangle. It goes away when resizing the window even the
slightest bit. The tabs are selectable if you can guess where they are
but selecting them doesn't make them visible. I can provide a screen
grab to someone upon request.

Vic
Roger Binns
2004-10-30 20:29:35 UTC
Permalink
[Various Mac gui glitches ...]
Patches to fix them or a loaner Mac are welcome :-)

Roger
Vic Heintz
2004-10-30 20:42:04 UTC
Permalink
Post by Roger Binns
[Various Mac gui glitches ...]
Patches to fix them or a loaner Mac are welcome :-)
Any hints about where to look for the code that controls background
color on those widgets? I'd be happy to attempt a patch.

Vic
Roger Binns
2004-10-30 21:12:29 UTC
Permalink
Post by Vic Heintz
Any hints about where to look for the code that controls background
color on those widgets? I'd be happy to attempt a patch.
BitPim isn't setting it explicitly. The easiest thing is to get the wxPython
demo and see if that has the problem. If it does, then report it as a wxPython
bug. If it doesn't, then look at how BitPim uses the widget differently than
the demo.

Roger
Vic Heintz
2004-10-31 02:15:05 UTC
Permalink
Post by Roger Binns
Post by Vic Heintz
Any hints about where to look for the code that controls background
color on those widgets? I'd be happy to attempt a patch.
BitPim isn't setting it explicitly. The easiest thing is to get the
wxPython
demo and see if that has the problem. If it does, then report it as a
wxPython
bug. If it doesn't, then look at how BitPim uses the widget
differently than
the demo.
Thanks, you were right. The demo exhibited all of the glitches seen in
BitPim. I submitted a bug report with a screen grab to the wxPython
folks.

Vic

Loading...