Skip to content

Commit

Permalink
pyvisa: run new black version
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuDartiailh committed Aug 26, 2020
1 parent 293cc1d commit 534823b
Show file tree
Hide file tree
Showing 23 changed files with 195 additions and 565 deletions.
2 changes: 1 addition & 1 deletion pyvisa/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ class UnknownHandler(Error):
"""

def __init__(
self, event_type: EventType, handler: typing.VISAHandler, user_handle: Any,
self, event_type: EventType, handler: typing.VISAHandler, user_handle: Any
) -> None:
super(UnknownHandler, self).__init__(
"%s, %s, %s" % (event_type, handler, user_handle)
Expand Down
6 changes: 2 additions & 4 deletions pyvisa/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Event:

@classmethod
def register(
cls, event_type: constants.EventType,
cls, event_type: constants.EventType
) -> Callable[[Type["Event"]], Type["Event"]]:
"""Register a class with a given event type."""

Expand Down Expand Up @@ -177,9 +177,7 @@ class IOCompletionEvent(Event):

@property
def data(self):
"""Portion of the buffer that was actually filled during the call.
"""
"""Portion of the buffer that was actually filled during the call."""
return bytes(self.buffer[: self.return_count])


Expand Down
2 changes: 1 addition & 1 deletion pyvisa/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ def open(
"""
raise NotImplementedError

def open_default_resource_manager(self,) -> Tuple[VISARMSession, StatusCode]:
def open_default_resource_manager(self) -> Tuple[VISARMSession, StatusCode]:
"""This function returns a session to the Default Resource Manager resource.
Corresponds to viOpenDefaultRM function of the VISA library.
Expand Down
2 changes: 1 addition & 1 deletion pyvisa/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def install_handler(
)

def wrap_handler(
self, callable: Callable[["Resource", Event, Any], None],
self, callable: Callable[["Resource", Event, Any], None]
) -> VISAHandler:
"""Wrap an event handler to provide the signature expected by VISA.
Expand Down
12 changes: 4 additions & 8 deletions pyvisa/rname.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ def bad_syntax(

@classmethod
def subclass_notfound(
cls, interface_type_resource_class: Tuple[str, str], resource_name: str = None,
cls, interface_type_resource_class: Tuple[str, str], resource_name: str = None
) -> "InvalidResourceName":
"""Build an exception when no parser has been registered for a pair.
"""
"""Build an exception when no parser has been registered for a pair."""

msg = "Parser not found for: %s." % (interface_type_resource_class,)

Expand All @@ -81,9 +79,7 @@ def subclass_notfound(
def rc_notfound(
cls, interface_type: str, resource_name: str = None
) -> "InvalidResourceName":
"""Build an exception when no resource class is provided and no default is found.
"""
"""Build an exception when no resource class is provided and no default is found."""

msg = (
"Resource class for %s not provided and default not found." % interface_type
Expand Down Expand Up @@ -783,7 +779,7 @@ def raise_missing_attr(self, item):


def filter2(
resources: Iterable[str], query: str, open_resource: Callable[[str], "Resource"],
resources: Iterable[str], query: str, open_resource: Callable[[str], "Resource"]
) -> Tuple[str, ...]:
"""Filter a list of resources according to a query expression.
Expand Down
4 changes: 1 addition & 3 deletions pyvisa/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ def do_exit(self, arg):
return True

def do_EOF(self, arg):
"""Handle an EOF.
"""
"""Handle an EOF."""
return True


Expand Down

0 comments on commit 534823b

Please sign in to comment.