Skip to content
Snippets Groups Projects
Commit 4afe2759 authored by Taya Snijder's avatar Taya Snijder
Browse files

finished processing feedback

parent bc2aca25
No related branches found
No related tags found
1 merge request!24Resolve #2021 "04 16 branched from master ini file device"
......@@ -58,7 +58,7 @@ class ini_client(CommClient):
self.config_file = open(self.filename, "r")
self.connected = True # set connected to true
return True # if succesfull, return true. otherwise return false
return True # if successful, return true. otherwise return false
def disconnect(self):
self.connected = False # always force a reconnect, regardless of a successful disconnect
......@@ -73,16 +73,21 @@ class ini_client(CommClient):
example annotation may include:
- a file path and file line/location
- COM object path
Annotations:
name: Required, the name of the ini variable
section: Required, the section of the ini variable
"""
# as this is an example, just print the annotation
self.streams.debug_stream("annotation: {}".format(annotation))
name = annotation.get('name')
if name is None:
AssertionError("ini client requires a variable name to set/get")
ValueError("ini client requires a variable `name` in the annotation to set/get")
section = annotation.get('section')
if section is None:
AssertionError("requires a section to open")
ValueError("requires a `section` specified in the annotation to open")
return section, name
......@@ -120,13 +125,8 @@ class ini_client(CommClient):
def write_function(value):
if type(value) is list:
write_value = ""
for i in value:
write_value = write_value + str(value) + ", "
write_value = ", ".join([str(v) for v in value])
# strip the extra ", " at the end
write_value = write_value[:-2]
else:
write_value = str(value)
......
......@@ -96,22 +96,6 @@ class ini_device(hardware_device):
str_image_RW = attribute_wrapper(comms_annotation={"section": "image", "name": "str_image_RW"}, datatype=numpy.str_, dims=(3, 2), access=AttrWriteType.READ_WRITE)
str_image_R = attribute_wrapper(comms_annotation={"section": "image", "name": "str_image_R"}, datatype=numpy.str_, dims=(3, 2))
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
pass
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command (a Tango built-in).
"""
self.debug_stream("Shutting down...")
self.Off()
self.debug_stream("Shut down. Good bye.")
# --------
# overloaded functions
# --------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment