Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

device.py: fix _add_pv_properties() for alias

  • Loading branch information...
commit 13553bfc04aeff5cceeb260cc11581b790d5caf0 1 parent ca0257f
@peteut authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/device.py
View
11 lib/device.py
@@ -85,7 +85,8 @@ class Device(object):
def _add_pv_property(self, pv_name, name=None):
"compose property"
- name = name or pv_name.upper()
+ pv_name = pv_name.upper()
+ name = name or pv_name
def get(self, pv_name):
"helper for getter, return value"
@@ -110,8 +111,8 @@ def put(self, pv_name, val):
if not hasattr(self.__class__, name):
setattr(self.__class__,
name.lower(),
- property(lambda self: get(self, name),
- lambda self, val: put(self, name, val),
+ property(lambda self: get(self, pv_name),
+ lambda self, val: put(self, pv_name, val),
None,
))
@@ -125,8 +126,8 @@ def __init__(self, prefix='', attrs=None, alias=None, delim='',
map(self._add_pv_property, attrs)
if alias:
map(partial(self._add_pv_property),
- map(self.get_pv, alias.values()),
- alias.keys())
+ alias.values(),
+ alias.keys())
ca.poll()
def get_pv(self, attr, connect=True, timeout=None):
Please sign in to comment.
Something went wrong with that request. Please try again.