Skip to content
Snippets Groups Projects
Commit 922fe566 authored by Martin Scarcia's avatar Martin Scarcia
Browse files

removed filter script + consequent bug on w/r functions

parent 260611b6
No related branches found
No related tags found
No related merge requests found
......@@ -220,24 +220,6 @@ class Dynamic(PyTango.Device_4Impl):
self.write_functions = CaseLessDict()
#link to the Tango DB
self.db = PyTango.Database()
if self.FiltersScript:
aux = self.FiltersScript.split('/')
path = '/'.join(aux[:-1])
if path:
if path not in sys.path:
sys.path.insert(0, path)
module_name = aux[-1].replace('.py','')
try:
self.module = __import__(module_name)
except ImportError as ex:
#sys.stderr.write(str(ex)+"\n")
self.module = None
self.set_state(PyTango.DevState.FAULT)
self.set_status("Invalid Filters Script " + self.FiltersScript )
return
else:
self.module = None
# import the configuration script as a module
if self.ConfiguratorScript:
......@@ -568,7 +550,7 @@ class Dynamic(PyTango.Device_4Impl):
#------------------------------------------------------------------
def read_dynamic_attribute(self, attr_name):
if self.read_functions[attr_name]:
read_method = getattr(self.module,self.read_functions[attr_name])
read_method = getattr(self.cfg_module,self.read_functions[attr_name])
num_of_args = read_method.__code__.co_argcount
if num_of_args == 1:
# If method allows an input parameter,
......@@ -586,7 +568,7 @@ class Dynamic(PyTango.Device_4Impl):
#------------------------------------------------------------------
def write_dynamic_attribute(self, attr_name, value_in):
if self.write_functions[attr_name]:
write_method = getattr(self.module,self.write_functions[attr_name])
write_method = getattr(self.cfg_module,self.write_functions[attr_name])
num_of_args = write_method.__code__.co_argcount
if num_of_args == 2:
# If method allows two input parameter,
......@@ -622,10 +604,6 @@ class DynamicClass(PyTango.DeviceClass):
[PyTango.DevString,
"Path to the config file",
[] ],
'FiltersScript':
[PyTango.DevString,
"Path to the python script that will be executed.",
[] ],
'DefaultCfgScript':
[PyTango.DevString,
"Path to the default config file",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment