From 9a9ffd5594a5d27bbecf6160de2c33d44870f5bd Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Wed, 17 Feb 2016 17:20:25 +0100 Subject: Refactor pcipywrap to object --- xml/test_pywrap/test_prop2.py | 10 ++++------ xml/test_pywrap/test_prop3.py | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'xml') diff --git a/xml/test_pywrap/test_prop2.py b/xml/test_pywrap/test_prop2.py index d7e10bc..d78dbea 100644 --- a/xml/test_pywrap/test_prop2.py +++ b/xml/test_pywrap/test_prop2.py @@ -1,8 +1,6 @@ -import pcipywrap - -def read_from_register(value): - return pcipywrap.get_property('/test/prop3') / 2 +def read_from_register(ctx, value): + return ctx.get_property('/test/prop3') / 2 -def write_to_register(value): - pcipywrap.set_property(value*2, '/test/prop3') +def write_to_register(ctx, value): + ctx.set_property(value*2, '/test/prop3') diff --git a/xml/test_pywrap/test_prop3.py b/xml/test_pywrap/test_prop3.py index 9d33b63..a082096 100644 --- a/xml/test_pywrap/test_prop3.py +++ b/xml/test_pywrap/test_prop3.py @@ -1,7 +1,5 @@ -import pcipywrap - -def read_from_register(value): - return pcipywrap.get_property('/registers/fpga/reg1') +def read_from_register(ctx, value): + return ctx.get_property('/registers/fpga/reg1') -def write_to_register(value): - pcipywrap.set_property(value, '/registers/fpga/reg1') +def write_to_register(ctx, value): + ctx.set_property(value, '/registers/fpga/reg1') -- cgit v1.2.3