On 11/30/06, Peter Kropf <[EMAIL PROTECTED]> wrote:
> On 11/26/06, Jerry Scharf <[EMAIL PROTECTED]> wrote:

[--snip--]

> > Second, I extended the program to set the error codes, thinking this
> > might have something to do with the runaway code. I inserted
> > ow.error_level(ow.error_level.fatal)
> > ow.error_print(ow.error_print.stderr)
> > after ow.init.
> >
> > pdb says:
> >  > /home/scharf/house/dbcontrols/python/owtest.py(3)?()
> > -> import ow
> > (Pdb) n
> >  > /home/scharf/house/dbcontrols/python/owtest.py(5)?()
> > -> ow.init('127.0.0.1:2840')
> > (Pdb) n
> >  > /home/scharf/house/dbcontrols/python/owtest.py(7)?()
> > -> ow.error_level(ow.error_level.fatal)
> > (Pdb) n
> > AttributeError: "'module' object has no attribute 'cvar'"
> >  > /home/scharf/house/dbcontrols/python/owtest.py(7)?()
> > -> ow.error_level(ow.error_level.fatal)
> >
> > I located cvar in the __init__ code, but am not familiar with this level
> > of python...
>
> I haven't seen this before. Let me dig into the code a bit and get back to 
> you.


Looks like this was a problem cause by the error_level and error_print
variables being moved into a global structure inside the core OW code
library. There's a new version of modules/swig/ow.i and
modules/swig/python/ow/__init__.py that should resolve the problem.
Here's a sample program and output:

$ cat /tmp/z.py
import ow

ow.init('u')
r = ow.Sensor('/')
print r.entryList()
print r.sensorList()
ow.error_level(ow.error_level.debug)
print r.sensorList()
$
$ python /tmp/z.py
['structure', 'bus.0', 'uncached', 'settings', 'system', 'statistics',
'alarm', 'simultaneous']
[Sensor("/10.B7B64D000800"), Sensor("/26.AF2E15000000"),
Sensor("/81.A44C23000000")]
   CALL: PARSENAME path=[/]
   CALL: DIRECTORY path=/
   CALL: PARSENAME path=[structure/type]
   CALL: PARSENAME path=[bus.0/type]
   CALL: PARSENAME path=[uncached/type]
   CALL: PARSENAME path=[settings/type]
   CALL: PARSENAME path=[system/type]
   CALL: PARSENAME path=[statistics/type]
   CALL: PARSENAME path=[10.B7B64D000800/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=7 offset=0
   CALL: PARSENAME path=[/10.B7B64D000800/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=7 offset=0
   CALL: PARSENAME path=[/10.B7B64D000800]
   CALL: DIRECTORY path=/10.B7B64D000800
   CALL: PARSENAME path=[26.AF2E15000000/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=6 offset=0
   CALL: PARSENAME path=[/26.AF2E15000000/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=6 offset=0
   CALL: PARSENAME path=[/26.AF2E15000000]
   CALL: DIRECTORY path=/26.AF2E15000000
   CALL: PARSENAME path=[81.A44C23000000/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=6 offset=0
   CALL: PARSENAME path=[/81.A44C23000000/type]
   CALL: FS_r_single: format=6 s=32 offset=0
   CALL: FS_r_single: format=6 s=6 offset=0
   CALL: PARSENAME path=[/81.A44C23000000]
   CALL: DIRECTORY path=/81.A44C23000000
   CALL: PARSENAME path=[alarm/type]
   CALL: PARSENAME path=[simultaneous/type]
[Sensor("/10.B7B64D000800"), Sensor("/26.AF2E15000000"),
Sensor("/81.A44C23000000")]
$

Try it out and let me know how it works for you...

- Peter

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to