Commit a6a945baec9 by Julien Salort

Use super() instead of super(ClassName, self)

parent 00377566b5a
......@@ -33,7 +33,7 @@ class Julabo(Driver):
}
def __enter__(self):
super(Julabo, self).__enter__()
super().__enter__()
identification = self.interface.query("version")
print("identification =", repr(identification))
return self
......
......@@ -142,7 +142,7 @@ class Lauda(Driver):
}
def __enter__(self):
super(Lauda, self).__enter__()
super().__enter__()
identification = self.interface.query(b"TYPE\r").decode("ascii")
if identification not in Lauda.Models:
if len(identification) > 0:
......
......@@ -136,7 +136,7 @@ class IEC60488(Driver):
default_physical_interface = PhysicalInterfaceType.GPIB
def __enter__(self):
super(IEC60488, self).__enter__()
super().__enter__()
identification = self.query_identification()
if isinstance(identification, str):
......
......@@ -122,7 +122,7 @@ class PfeifferMaxiGauge(Driver):
self.debug = debug
def __enter__(self):
super(PfeifferMaxiGauge, self).__enter__()
super().__enter__()
self.clear_interface()
print("Pfeiffer MaxiGauge:", self.program_version().decode("ascii"))
......
......@@ -45,7 +45,7 @@ def closest_timeout(t):
class GPIBInterface(QueryInterface):
def __init__(self, board_adress, instrument_adress, timeout=1.0):
super(GPIBInterface, self).__init__()
super().__init__()
self.board_adress = board_adress
self.instrument_adress = instrument_adress
self.default_tmo = closest_timeout(timeout)
......
......@@ -44,7 +44,7 @@ class SerialInterface(QueryInterface):
To automatically add '\n' on writes, and remove '\r\n' on reads, set
autoremove_eol to True
"""
super(SerialInterface, self).__init__()
super().__init__()
self.port = port
self.baudrate = baudrate
self.bytesize = bytesize
......
......@@ -17,7 +17,7 @@ from fluidlab.interfaces import QueryInterface
class SocketInterface(QueryInterface):
def __init__(self, ip_address, port, autoremove_eol=True):
super(SocketInterface, self).__init__()
super().__init__()
self.ip_address = ip_address
self.port = port
self.autoremove_eol = autoremove_eol
......
......@@ -38,7 +38,7 @@ class USBTMCInterface(QueryInterface):
device number (e.g. 0)
"""
super(USBTMCInterface, self).__init__()
super().__init__()
if isinstance(device, bytes):
device = device.decode("ascii")
if isinstance(device, Path):
......
......@@ -21,7 +21,7 @@ resource_managers = dict() # key: backend(str), object: rm
class VISAInterface(QueryInterface):
def __init__(self, resource_name, backend=None):
super(VISAInterface, self).__init__()
super().__init__()
self.resource_name = resource_name
if backend is None:
backend = default_visa_backend
......
......@@ -37,7 +37,7 @@ from fluidlab.objects.pinchvalve import PinchValve, tube_as_opened_as_possible
# """A class handling the temperature probe."""
# def __init__(self, board=None):
# super(TemperatureProbe, self).__init__(board=board)
# super().__init__(board=board)
class ConductivityProbe(ObjectUsingBoard):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment