Skip to content

Commit

Permalink
Added property to resource name returning the InterfaceType value
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed Apr 30, 2015
1 parent 069b7e7 commit 404df02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyvisa/rname.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ class ResourceName(object):
# Resource name provided by the user (not empty only when parsing)
user = ''

@property
def interface_type_const(self):
try:
return getattr(constants.InterfaceType, self.interface_type.lower())
except:
return constants.InterfaceType.unknown

@classmethod
def from_string(cls, resource_name):
"""Parse a resource name and return a ResourceName
Expand Down

0 comments on commit 404df02

Please sign in to comment.