diff options
author | Hernan Grecco <hernan.grecco@gmail.com> | 2014-10-13 23:47:07 -0300 |
---|---|---|
committer | Hernan Grecco <hernan.grecco@gmail.com> | 2014-10-13 23:47:07 -0300 |
commit | c633c78f0e6d3999bd2f3e094989875e0530d723 (patch) | |
tree | f4a1d39cce0c13fafde9faa5bc4728e4f70ac396 | |
parent | f9d9aaf4458f00b716f9b3d0cabb2f116173f12e (diff) |
Doc, code style and CHANGES
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | pyvisa/attributes.py | 8 | ||||
-rw-r--r-- | pyvisa/highlevel.py | 2 | ||||
-rw-r--r-- | pyvisa/util.py | 2 |
4 files changed, 11 insertions, 7 deletions
@@ -5,7 +5,11 @@ PyVISA Changelog 1.6.1 (unreleased) ------------------ -- Nothing changed yet. +- Add ignore_warning methods to Resource and ResourceManager. +- Added more formats to binary values. + (Issue #92) +- Fixed exception raising in legacy read_values. + (Issue #91) 1.6 (2014-09-28) diff --git a/pyvisa/attributes.py b/pyvisa/attributes.py index 9c3ec7b..81c4385 100644 --- a/pyvisa/attributes.py +++ b/pyvisa/attributes.py @@ -99,7 +99,7 @@ class Attribute(with_metaclass(AttributeType)): instance.set_visa_attribute(self.attribute_id, self.pre_set(value)) @classmethod - def in_resource(self, session_type): + def in_resource(cls, session_type): """Returns True if the attribute is part of a given session type. The session_type is a tuple with the interface type and resource_class @@ -107,16 +107,16 @@ class Attribute(with_metaclass(AttributeType)): :type session_type: (constants.InterfaceType, str) :rtype: bool """ - if self.resources is AllSessionTypes: + if cls.resources is AllSessionTypes: return True - return session_type in self.resources + return session_type in cls.resources class EnumAttribute(Attribute): """Class for attributes with values that map to a PyVISA Enum. """ - # Enum type with valid values. + #: Enum type with valid values. enum_type = None @classmethod diff --git a/pyvisa/highlevel.py b/pyvisa/highlevel.py index 33210fa..14108d8 100644 --- a/pyvisa/highlevel.py +++ b/pyvisa/highlevel.py @@ -121,7 +121,7 @@ class VisaLibraryBase(object): """Override this method to return an iterable of possible library_paths to try in case that no argument is given. """ - return ('unset', ) + return tuple('unset', ) def _init(self): """Override this method to customize VisaLibrary initialization. diff --git a/pyvisa/util.py b/pyvisa/util.py index 499c76b..ae9fd0f 100644 --- a/pyvisa/util.py +++ b/pyvisa/util.py @@ -211,7 +211,7 @@ def to_ascii_block(iterable, converter='f', separator=','): if isinstance(separator, string_types): separator = separator.join - if isinstance(converter, str): + if isinstance(converter, string_types): converter = '%' + converter return separator(converter % val for val in iterable) else: |