|
From: Dan L. <dl...@gm...> - 2008-09-16 09:34:16
|
Frank Mori Hess writes:
> On Monday 15 September 2008 12:44, Dan Lenski wrote:
>> * Function naming: some function names are expanded, e.g. ibwrt() ->
>> gpib.write, while others are left in their terse form, e.g. ibtrg() ->
>> gpib.trg(). Should these be named uniformly?
>
> Yes
>
>> Should we keep the terse
>> names or the long names?
>
> I slightly prefer the long names, but either way is fine.
>
>> * Return values: some Python functions return their C return values
>> (e.g. the wrappers for ibdev(), ibfind(), ibwait()). Others get the
>> interesting return value from a C pointer, e.g. the wrappers for ibrd(),
>> ibln(), ibask (), etc. That's all well and good I think. But many of
>> the Python functions return *nothing* for no apparent reason. Should
>> these just return ibsta as in C? There's no downside to this...
>
> Ok
You want it, you got it. Here's a patch on the current SVN. A whole
bunch of changes:
* fixed error handling to get errno from the right place
* __doc__ strings for every function (modeled on the ones Keith had written)
* a few function names made less terse:
cmd->command
tmo->timeout
trg->trigger
(I left ren, rsp, and ifc alone since remote_enable, request_serial_poll,
and interface_clear seemed unreasonable long to me, but those could be
changed as well.)
* integer constants for IbaXXXX and IbcXXXX added to the module
* all functions--that don't have something else useful to return--return
ibsta, just like the C versions
* the read() function now puts its result directly into the Python output
string, with /no copying/ from a C string to a Python string. This should
improve efficiency of large and/or frequent reads.
I'm itching to improve the Python wrapper class in Gpib.py,
but decided to restrain myself from any further changes in this patch :-)
Especially if some people are using it in its current form.
Dan
|