gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] tuples returned by run_ro_query


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] tuples returned by run_ro_query
Date: Tue, 23 Sep 2003 13:03:58 +0200
User-agent: Mutt/1.3.22.1i

On Tue, Sep 23, 2003 at 07:54:21PM +1000, Ian Haywood wrote:
> 
> 2003-09-23 18:10:23 [PANIC] (gmTmpPatient.py::__init__:409): Traceback
> (most recent call last):<#10-0x0A-lf>
> 2003-09-23 18:10:23 [PANIC] (gmTmpPatient.py::__init__:409):   File
> "gmTmpPatient.py", line 404, in
> __init__<#10-0x0A-lf>
>  self.patient = gmPerson(aPKey)<#10-0x0A-lf>
> 2003-09-23 18:10:23 [PANIC] (gmTmpPatient.py::__init__:409):   File
> "gmTmpPatient.py", line 83, in
> __init__<#10-0x0A-lf>
> if not self._pkey_exists():<#10-0x0A-lf>
> 2003-09-23 18:10:23 [PANIC] (gmTmpPatient.py::__init__:409):   File
> "gmTmpPatient.py", line 114, in
> _pkey_exists<#10-0x0A-lf>    res, = gmPG.run_ro_query('personalia', cmd,
> None, self.ID)<#10-0x0A-lf>
> 2003-09-23 18:10:23 [PANIC] (gmTmpPatient.py::__init__:409): ValueError:
> unpack tuple of wrong size<#10-0x0A-lf>
>                                                                               
>                                                
> My setup chokes when trying to squeeze the two-tuple returned from
> run_ro_query into a single variable.
Hm, funny. As I read the code it doesn't do such:

res, = run_ro_query()
   ^
means "throw away the following tuple parts", no ?

But the error sure enough says so.

> Can we change the end of run_ro_query to:
>         pool.ReleaseConnection (aSerive)
>         if get_col_idx is None:
>                 curs.close ()
>                 return data
>         else:
>                 col_idx = get_col_indices (curs)
>                 curs.close ()
>                 return data, col_idx
We sure can. I've been thinking of doing it like this but
decided against it for sake of consistence. I'll put some more
thought into it. I guess, if you can see merit in returning
like that I'll just do it.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]