Discussion:
[BitPim-devel] support for lists
Ed leNoir
2005-02-22 03:16:36 UTC
Permalink
I lost quite a bit of time today working with a new list in a protocol. The pm325 has the speed dials in the protocol, and it's handled just like the number types in the vx4400. Unfortunately I didn't locate the special handling for lists in the phones "makeentry" routine - I would have thought the lists were self sufficient. The error raised is that the sub item in the list is sent the entire array, and not just nth element. Here's the code from the com_ portion:

(part of makeentry)
e=self.protocolclass.pbentry()
e.entrynumber=counter

for k in entry:
# special treatment for lists
if k in ('emails', 'numbers', 'numbertypes'):
l=getattr(e,k)
for item in entry[k]:
l.append(item)

I was thinking that protogen should have generated code to handle the arrays. Is this something I should pursue, or has there been debate before?

- Ed
Roger Binns
2005-02-22 04:38:53 UTC
Permalink
Post by Ed leNoir
I was thinking that protogen should have generated code to
handle the arrays. Is this something I should pursue, or
has there been debate before?
protogen generates classes and attributes that are
schizophrenic. On the one hand they have to behave
like ordinary values (eg ints, strings) and on the
other they carry baggage and values such as how many
bytes to encode as, default values, terminators etc.
The objects are also created on use rather than
always being present and exceptions catch using
them without them having been set.

That said there is nowhere near sufficient information
in your message to work out what the issue is.

Roger
Ed leNoir
2005-02-23 06:13:11 UTC
Permalink
Post by Roger Binns
That said there is nowhere near sufficient information
in your message to work out what the issue is.
Yeah, I was a bit sparse on the messages. I'm doing my development on one
machine, and email on another, so I'm never on the machine with the messages
when I'm writing the email. I'll look a bit more at what the code that is
in the phone class is doing, and see if there is a recommendation I can post
in code along with what it's fixing.

- Ed

----- Original Message -----
From: "Roger Binns" <***@rogerbinns.com>
To: <bitpim-***@lists.sourceforge.net>
Sent: Monday, February 21, 2005 8:38 PM
Subject: Re: [BitPim-devel] support for lists
Post by Roger Binns
Post by Ed leNoir
I was thinking that protogen should have generated code to handle the
arrays. Is this something I should pursue, or has there been debate
before?
protogen generates classes and attributes that are schizophrenic. On the
one hand they have to behave
like ordinary values (eg ints, strings) and on the
other they carry baggage and values such as how many
bytes to encode as, default values, terminators etc.
The objects are also created on use rather than
always being present and exceptions catch using
them without them having been set.
That said there is nowhere near sufficient information
in your message to work out what the issue is.
Roger
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Loading...