From e7b96caa8269e0dcb187ba3883b0697cdf775358 Mon Sep 17 00:00:00 2001 From: Ivan Kosarev Date: Sat, 20 Feb 2021 23:58:44 +0200 Subject: [PATCH] [#18] Do not associate devices with specific machine instances. --- zx/_device.py | 3 +-- zx/_emulator.py | 2 +- zx/_gui.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/zx/_device.py b/zx/_device.py index 47c989c..dd18f5a 100644 --- a/zx/_device.py +++ b/zx/_device.py @@ -74,5 +74,4 @@ class ToggleTapePause(DeviceEvent): class Device(object): - def __init__(self, xmachine): - self.xmachine = xmachine + pass diff --git a/zx/_emulator.py b/zx/_emulator.py index 9d7e4c2..273cd56 100644 --- a/zx/_emulator.py +++ b/zx/_emulator.py @@ -65,7 +65,7 @@ def __init__(self, speed_factor=1.0, profile=None, devices=None): # Don't even create the window on full throttle. if devices is None and self.__speed_factor is not None: - devices = Dispatcher([self, ScreenWindow(self)]) + devices = Dispatcher([self, ScreenWindow()]) self.devices = devices diff --git a/zx/_gui.py b/zx/_gui.py index 4729503..73daee1 100644 --- a/zx/_gui.py +++ b/zx/_gui.py @@ -195,8 +195,8 @@ class ScreenWindow(Device): 'ALT_R': 'SYMBOL SHIFT', 'SHIFT_R': 'SYMBOL SHIFT'} - def __init__(self, emulator): - super().__init__(emulator) + def __init__(self): + super().__init__() self.__events = []