Re: 0.7.33 build
"Roger Binns" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <001c01c5633e$9a358c90$3501a8c0@rogersqyvr14d3> |
> One thing I would like to do is get rid of the need to put
> {'terminator': None} for the last item of a csv string. Can a type in
> prototypes.py know if if it is the last item in a PACKET definition?
> If not, perhaps end of string can always be a valid terminator. If a
> csv string terminates early, then later items in the packet definition
> will cause errors.
It wouldn't be practical to pass a special parameter to the last item
since then all types would have to support it.
If the string is in a prototypes.buffer then things are pretty simple.
You can call buffer.hasmore() to know if it has any more data. You
can then do as your plan - allow end of string as a valid terminator
and have items fail if you are already at the end of string when
they start. In theory you might also be able to abuse this if
there is ever a need to have optional items on the end since
they could allow being started at the end of string.
Roger
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005