diff --git a/src/xpra/colorstreamhandler.py b/src/xpra/colorstreamhandler.py index 41ac2e0d41..32e2951246 100644 --- a/src/xpra/colorstreamhandler.py +++ b/src/xpra/colorstreamhandler.py @@ -54,11 +54,8 @@ def _get_color(cls, level): return cls.DEBUG return cls.DEFAULT - def __init__(self, stream=None): - logging.StreamHandler.__init__(self, stream) - def format(self, record): - text = logging.StreamHandler.format(self, record) + text = super().format(record) color = self._get_color(record.levelno) return color + text + self.DEFAULT @@ -111,7 +108,7 @@ def _set_color(self, code): ctypes.windll.kernel32.SetConsoleTextAttribute(self._outhdl, code) #@UndefinedVariable def __init__(self, stream=None): - logging.StreamHandler.__init__(self, stream) + super().__init__(stream) # get file handle for the stream import ctypes.util crtname = ctypes.util.find_msvcrt() @@ -121,7 +118,7 @@ def __init__(self, stream=None): def emit(self, record): color = self._get_color(record.levelno) self._set_color(color) - logging.StreamHandler.emit(self, record) + super().emit(record) self._set_color(self.FOREGROUND_WHITE) # select ColorStreamHandler based on platform diff --git a/src/xpra/log.py b/src/xpra/log.py index f285d61f99..2f9909843f 100644 --- a/src/xpra/log.py +++ b/src/xpra/log.py @@ -411,7 +411,7 @@ def error(self, msg : str, *args, **kwargs): class CaptureHandler(logging.Handler): def __init__(self): - logging.Handler.__init__(self, logging.DEBUG) + super().__init__(logging.DEBUG) self.records = [] def handle(self, record): diff --git a/src/xpra/platform/darwin/gui.py b/src/xpra/platform/darwin/gui.py index 6459beafa3..ab7fb10ffc 100644 --- a/src/xpra/platform/darwin/gui.py +++ b/src/xpra/platform/darwin/gui.py @@ -122,7 +122,7 @@ def do_ready(): class OSX_Notifier(NotifierBase): def __init__(self, closed_cb=None, action_cb=None): - NotifierBase.__init__(self, closed_cb, action_cb) + super().__init__(closed_cb, action_cb) self.notifications = {} self.notification_center = NSUserNotificationCenter.defaultUserNotificationCenter() assert self.notification_center diff --git a/src/xpra/platform/darwin/keyboard.py b/src/xpra/platform/darwin/keyboard.py index 79d9d387e7..21207e584a 100644 --- a/src/xpra/platform/darwin/keyboard.py +++ b/src/xpra/platform/darwin/keyboard.py @@ -138,7 +138,7 @@ def get_keymap_modifiers(self): return {}, [], ["lock", "control"] def set_modifier_mappings(self, mappings): - KeyboardBase.set_modifier_mappings(self, mappings) + super().set_modifier_mappings(mappings) self.meta_modifier = self.modifier_keys.get("Meta_L") or self.modifier_keys.get("Meta_R") self.control_modifier = self.modifier_keys.get("Control_L") or self.modifier_keys.get("Control_R") or "control" self.super_modifier = self.modifier_keys.get("Super_L") or self.modifier_keys.get("Super_R") diff --git a/src/xpra/platform/darwin/osx_clipboard.py b/src/xpra/platform/darwin/osx_clipboard.py index f586caea30..dee4dd4879 100644 --- a/src/xpra/platform/darwin/osx_clipboard.py +++ b/src/xpra/platform/darwin/osx_clipboard.py @@ -33,7 +33,7 @@ def __init__(self, *args, **kwargs): raise Exception("cannot load Pasteboard, maybe not running from a GUI session?") kwargs["clipboard.local"] = "CLIPBOARD" kwargs["clipboards.local"] = ["CLIPBOARD"] - ClipboardTimeoutHelper.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) def __repr__(self): @@ -57,7 +57,7 @@ def make_proxy(self, clipboard): def _munge_wire_selection_to_raw(self, encoding, dtype, dformat, data): if encoding=="atoms": return _filter_targets(data) - return ClipboardTimeoutHelper._munge_wire_selection_to_raw(self, encoding, dtype, dformat, data) + return super()._munge_wire_selection_to_raw(encoding, dtype, dformat, data) class OSXClipboardProxy(ClipboardProxyCore): @@ -66,7 +66,7 @@ def __init__(self, selection, pasteboard, send_clipboard_request_handler, send_c self.pasteboard = pasteboard self.send_clipboard_request_handler = send_clipboard_request_handler self.send_clipboard_token_handler = send_clipboard_token_handler - ClipboardProxyCore.__init__(self, selection) + super().__init__(selection) self.update_change_count() #setup clipboard counter watcher: w = get_UI_watcher(GLib.timeout_add, GLib.source_remove) diff --git a/src/xpra/platform/darwin/osx_menu.py b/src/xpra/platform/darwin/osx_menu.py index b853c8b011..c726f6ef68 100644 --- a/src/xpra/platform/darwin/osx_menu.py +++ b/src/xpra/platform/darwin/osx_menu.py @@ -59,7 +59,7 @@ class OSXMenuHelper(GTKTrayMenuBase): """ def __init__(self, client=None): - GTKTrayMenuBase.__init__(self, client) + super().__init__(client) log("OSXMenuHelper(%s)", client) self.menu_bar = None self.hidden_window = None diff --git a/src/xpra/platform/darwin/osx_tray.py b/src/xpra/platform/darwin/osx_tray.py index 0fc9a3ef2b..226bfc5b0e 100644 --- a/src/xpra/platform/darwin/osx_tray.py +++ b/src/xpra/platform/darwin/osx_tray.py @@ -22,7 +22,7 @@ class OSXTray(TrayBase): def __init__(self, *args): - TrayBase.__init__(self, *args) + super().__init__(*args) from xpra.platform.darwin.gui import get_OSXApplication self.macapp = get_OSXApplication() assert self.macapp, "cannot use OSX Tray without the native gtkosx_application bindings" diff --git a/src/xpra/platform/darwin/shadow_server.py b/src/xpra/platform/darwin/shadow_server.py index 1ff84067eb..fd0e6a0bd5 100644 --- a/src/xpra/platform/darwin/shadow_server.py +++ b/src/xpra/platform/darwin/shadow_server.py @@ -144,12 +144,12 @@ def start_refresh(self, wid): return log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err) log.warn(" using fallback timer method") - GTKShadowServerBase.start_refresh(self, wid) + super().start_refresh(wid) def stop_refresh(self, wid): log("stop_refresh(%i) mapped=%s, timer=%s", wid, self.mapped, self.refresh_timer) #may stop the timer fallback: - GTKShadowServerBase.stop_refresh(self, wid) + super().stop_refresh(wid) if self.refresh_registered and not self.mapped: try: err = CG.CGUnregisterScreenRefreshCallback(self.screen_refresh_callback, None) diff --git a/src/xpra/platform/win32/clipboard.py b/src/xpra/platform/win32/clipboard.py index fe06f96a8e..53cbb8060a 100644 --- a/src/xpra/platform/win32/clipboard.py +++ b/src/xpra/platform/win32/clipboard.py @@ -62,7 +62,7 @@ class Win32Clipboard(ClipboardTimeoutHelper): """ def __init__(self, send_packet_cb, progress_cb=None, **kwargs): self.init_window() - ClipboardTimeoutHelper.__init__(self, send_packet_cb, progress_cb, **kwargs) + super().__init__(send_packet_cb, progress_cb, **kwargs) def init_window(self): log("Win32Clipboard.init_window() creating clipboard window class and instance") @@ -129,13 +129,13 @@ def make_proxy(self, selection): def _munge_wire_selection_to_raw(self, encoding, dtype, dformat, data): if encoding=="atoms": return _filter_targets(data) - return ClipboardTimeoutHelper._munge_wire_selection_to_raw(self, encoding, dtype, dformat, data) + return super()._munge_wire_selection_to_raw(encoding, dtype, dformat, data) def _munge_raw_selection_to_wire(self, target, dtype, dformat, data): if dtype=="ATOM": assert isinstance(data, (tuple, list)) return "atoms", _filter_targets(data) - return ClipboardTimeoutHelper._munge_raw_selection_to_wire(self, target, dtype, dformat, data) + return super()._munge_raw_selection_to_wire(target, dtype, dformat, data) class Win32ClipboardProxy(ClipboardProxyCore): @@ -143,7 +143,7 @@ def __init__(self, window, selection, send_clipboard_request_handler, send_clipb self.window = window self.send_clipboard_request_handler = send_clipboard_request_handler self.send_clipboard_token_handler = send_clipboard_token_handler - ClipboardProxyCore.__init__(self, selection) + super().__init__(selection) def set_want_targets(self, want_targets): self._want_targets = want_targets diff --git a/src/xpra/platform/win32/keyboard.py b/src/xpra/platform/win32/keyboard.py index 0b73d6e8d3..0cdaeb26ba 100644 --- a/src/xpra/platform/win32/keyboard.py +++ b/src/xpra/platform/win32/keyboard.py @@ -54,7 +54,7 @@ def __init__(self): KEY_TRANSLATIONS[("dead_grave", 65104, 55)] = "grave" def set_modifier_mappings(self, mappings): - KeyboardBase.set_modifier_mappings(self, mappings) + super().set_modifier_mappings(mappings) self.num_lock_modifier = self.modifier_keys.get("Num_Lock") log("set_modifier_mappings found 'Num_Lock' with modifier value: %s", self.num_lock_modifier) for x in ("ISO_Level3_Shift", "Mode_switch"): @@ -66,7 +66,7 @@ def set_modifier_mappings(self, mappings): def mask_to_names(self, mask): """ Patch NUMLOCK and AltGr """ - names = KeyboardBase.mask_to_names(self, mask) + names = super().mask_to_names(mask) if EMULATE_ALTGR: rmenu = GetKeyState(win32con.VK_RMENU) #log("GetKeyState(VK_RMENU)=%s", rmenu) @@ -207,7 +207,7 @@ def process_key_event(self, send_key_action_cb, wid, key_event): key_event.keycode = -1 self.AltGr_modifiers(key_event.modifiers) self.send_delayed_key() - KeyboardBase.process_key_event(self, send_key_action_cb, wid, key_event) + super().process_key_event(send_key_action_cb, wid, key_event) def send_delayed_key(self): #timeout: this must be a real one, send it now @@ -218,4 +218,4 @@ def send_delayed_key(self): rmenu = GetKeyState(win32con.VK_RMENU) log("send_delayed_key() GetKeyState(VK_RMENU)=%s", rmenu) if rmenu not in (0, 1): - KeyboardBase.process_key_event(self, *dk) + super().process_key_event(*dk) diff --git a/src/xpra/platform/win32/namedpipes/connection.py b/src/xpra/platform/win32/namedpipes/connection.py index 49abe51ee2..4bbc17d803 100644 --- a/src/xpra/platform/win32/namedpipes/connection.py +++ b/src/xpra/platform/win32/namedpipes/connection.py @@ -52,7 +52,7 @@ class NamedPipeConnection(Connection): def __init__(self, name, pipe_handle, options): log("NamedPipeConnection(%s, %#x)", name, pipe_handle, options) - Connection.__init__(self, name, "named-pipe", options=options) + super().__init__(name, "named-pipe", options=options) self.pipe_handle = pipe_handle self.read_buffer = (c_char*BUFSIZE)() self.read_buffer_ptr = cast(addressof(self.read_buffer), c_void_p) diff --git a/src/xpra/platform/win32/namedpipes/listener.py b/src/xpra/platform/win32/namedpipes/listener.py index cec5aa862d..19c31d727b 100644 --- a/src/xpra/platform/win32/namedpipes/listener.py +++ b/src/xpra/platform/win32/namedpipes/listener.py @@ -80,7 +80,7 @@ def __init__(self, pipe_name, new_connection_cb=None): self.pipe_name = pipe_name self.new_connection_cb = new_connection_cb or self.new_connection self.exit_loop = False - Thread.__init__(self, name="NamedPipeListener-%s" % pipe_name) + super().__init__(name="NamedPipeListener-%s" % pipe_name) self.daemon = True self.security_attributes = None self.security_descriptor = None diff --git a/src/xpra/platform/win32/shadow_server.py b/src/xpra/platform/win32/shadow_server.py index 0a195ad427..2d095a5272 100644 --- a/src/xpra/platform/win32/shadow_server.py +++ b/src/xpra/platform/win32/shadow_server.py @@ -218,7 +218,7 @@ def init_capture(w, h, pixel_depth=32): class SeamlessRootWindowModel(RootWindowModel): def __init__(self, root, capture): - RootWindowModel.__init__(self, root, capture) + super().__init__(root, capture) log("SeamlessRootWindowModel(%s, %s) SEAMLESS=%s", root, capture, SEAMLESS) self.property_names.append("shape") self.dynamic_property_names.append("shape") @@ -333,7 +333,7 @@ def get_property(self, prop): shape = {"Bounding.rectangles" : self.rectangles} #provide clip rectangle? (based on workspace area?) return shape - return RootWindowModel.get_property(self, prop) + return super().get_property(prop) class ShadowServer(GTKShadowServerBase): diff --git a/src/xpra/platform/win32/win32_notifier.py b/src/xpra/platform/win32/win32_notifier.py index e3937581e4..a32a7fec69 100644 --- a/src/xpra/platform/win32/win32_notifier.py +++ b/src/xpra/platform/win32/win32_notifier.py @@ -18,7 +18,7 @@ class Win32_Notifier(NotifierBase): def __init__(self, *args): - NotifierBase.__init__(self, *args) + super().__init__(*args) self.handles_actions = GTK_Notifier is not None self.gtk_notifier = None self.gtk_notifications = set() diff --git a/src/xpra/platform/win32/win32_tray.py b/src/xpra/platform/win32/win32_tray.py index 3816cd7165..90e13e504c 100755 --- a/src/xpra/platform/win32/win32_tray.py +++ b/src/xpra/platform/win32/win32_tray.py @@ -25,7 +25,7 @@ class Win32Tray(TrayBase): def __init__(self, *args): - TrayBase.__init__(self, *args) + super().__init__(*args) self.calculate_offset() self.default_icon_extension = "ico" icon_filename = get_icon_filename(self.default_icon_filename, "ico") diff --git a/src/xpra/platform/xposix/appindicator_tray.py b/src/xpra/platform/xposix/appindicator_tray.py index 4f887088c6..dd6491c65e 100644 --- a/src/xpra/platform/xposix/appindicator_tray.py +++ b/src/xpra/platform/xposix/appindicator_tray.py @@ -27,7 +27,7 @@ DELETE_TEMP_FILE = envbool("XPRA_APPINDICATOR_DELETE_TEMP_FILE", True) gi.require_version('AppIndicator3', '0.1') -from gi.repository import AppIndicator3, GdkPixbuf #pylint: disable=wrong-import-order +from gi.repository import AppIndicator3, GdkPixbuf #pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports PASSIVE = AppIndicator3.IndicatorStatus.PASSIVE ACTIVE = AppIndicator3.IndicatorStatus.ACTIVE @@ -39,7 +39,7 @@ def Indicator(tooltip, filename, status): class AppindicatorTray(TrayBase): def __init__(self, *args, **kwargs): - TrayBase.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) filename = get_icon_filename(self.default_icon_filename) or "xpra.png" self._has_icon = False self.tmp_filename = None diff --git a/src/xpra/scripts/config.py b/src/xpra/scripts/config.py index 32c40ec81f..fd98695aac 100755 --- a/src/xpra/scripts/config.py +++ b/src/xpra/scripts/config.py @@ -33,7 +33,7 @@ class InitInfo(Exception): class InitExit(Exception): def __init__(self, status, msg): self.status = status - Exception.__init__(self, msg) + super().__init__(msg) DEBUG_CONFIG_PROPERTIES = os.environ.get("XPRA_DEBUG_CONFIG_PROPERTIES", "").split() diff --git a/src/xpra/server/auth/env_auth.py b/src/xpra/server/auth/env_auth.py index 09c7de07dd..1f53ee60fc 100644 --- a/src/xpra/server/auth/env_auth.py +++ b/src/xpra/server/auth/env_auth.py @@ -11,7 +11,7 @@ class Authenticator(SysAuthenticator): def __init__(self, username, **kwargs): self.var_name = kwargs.pop("name", "XPRA_PASSWORD") - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.authenticate = self.authenticate_hmac def __repr__(self): diff --git a/src/xpra/server/auth/exec_auth.py b/src/xpra/server/auth/exec_auth.py index c3c7de36cf..d5af2182b5 100644 --- a/src/xpra/server/auth/exec_auth.py +++ b/src/xpra/server/auth/exec_auth.py @@ -45,7 +45,7 @@ def __init__(self, username, **kwargs): log("exec connection info: %s", connection) assert connection, "connection object is missing" self.connection_str = str(connection) - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) def requires_challenge(self) -> bool: return False diff --git a/src/xpra/server/auth/file_auth_base.py b/src/xpra/server/auth/file_auth_base.py index 069da83a26..371277d5d5 100644 --- a/src/xpra/server/auth/file_auth_base.py +++ b/src/xpra/server/auth/file_auth_base.py @@ -24,7 +24,7 @@ def __init__(self, username, **kwargs): exec_cwd = kwargs.get("exec_cwd", os.getcwd()) password_file = os.path.join(exec_cwd, password_file) log("FileAuthenticatorBase filename=%s", password_file) - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.password_filename = password_file self.password_filedata = None self.password_filetime = None diff --git a/src/xpra/server/auth/gss_auth.py b/src/xpra/server/auth/gss_auth.py index a2c9ed6604..964e4c3322 100755 --- a/src/xpra/server/auth/gss_auth.py +++ b/src/xpra/server/auth/gss_auth.py @@ -19,7 +19,7 @@ def __init__(self, username, **kwargs): self.gid = parse_gid(kwargs.pop("gid", None)) username = kwargs.pop("username", username) kwargs["prompt"] = kwargs.pop("prompt", "GSS token") - SysAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) log("gss auth: service=%s, username=%s", self.service, username) def get_uid(self): diff --git a/src/xpra/server/auth/hosts_auth.py b/src/xpra/server/auth/hosts_auth.py index d712d22978..bce30a8def 100644 --- a/src/xpra/server/auth/hosts_auth.py +++ b/src/xpra/server/auth/hosts_auth.py @@ -57,7 +57,7 @@ def __init__(self, username, **kwargs): raise self.peername = peername self.host = host - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) def requires_challenge(self) -> bool: return False diff --git a/src/xpra/server/auth/kerberos_password_auth.py b/src/xpra/server/auth/kerberos_password_auth.py index ecf313d8e4..e1c348574d 100755 --- a/src/xpra/server/auth/kerberos_password_auth.py +++ b/src/xpra/server/auth/kerberos_password_auth.py @@ -20,7 +20,7 @@ def __init__(self, username, **kwargs): self.uid = parse_uid(kwargs.pop("uid", None)) self.gid = parse_gid(kwargs.pop("gid", None)) username = kwargs.pop("username", username) - SysAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) log("kerberos-password auth: service=%s, realm=%s, username=%s", self.service, self.realm, username) def get_uid(self): @@ -36,7 +36,7 @@ def get_challenge(self, digests): if "xor" not in digests: log.error("Error: kerberos authentication requires the 'xor' digest") return None - return SysAuthenticatorBase.get_challenge(self, ["xor"]) + return super().get_challenge(["xor"]) def check(self, password) -> bool: try: diff --git a/src/xpra/server/auth/kerberos_token_auth.py b/src/xpra/server/auth/kerberos_token_auth.py index 0c2af6ac76..a7104d7ed8 100755 --- a/src/xpra/server/auth/kerberos_token_auth.py +++ b/src/xpra/server/auth/kerberos_token_auth.py @@ -20,7 +20,7 @@ def __init__(self, username, **kwargs): self.gid = parse_gid(kwargs.pop("gid", None)) username = kwargs.pop("username", username) kwargs["prompt"] = kwargs.pop("prompt", "kerberos token") - SysAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) log("kerberos-token auth: service=%s, username=%s", self.service, username) def get_uid(self): diff --git a/src/xpra/server/auth/ldap3_auth.py b/src/xpra/server/auth/ldap3_auth.py index 3b0baf0988..252803222b 100755 --- a/src/xpra/server/auth/ldap3_auth.py +++ b/src/xpra/server/auth/ldap3_auth.py @@ -38,7 +38,7 @@ def __init__(self, username, **kwargs): self.authentication = kwargs.pop("authentication", "NTLM").upper() assert self.authentication in ("SIMPLE", "SASL", "NTLM"), "invalid authentication mechanism '%s'" % self.authentication username = kwargs.pop("username", username) - SysAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) log("ldap auth: host=%s, port=%i, tls=%s", self.host, self.port, self.tls) @@ -55,7 +55,7 @@ def get_challenge(self, digests): if "xor" not in digests: log.error("Error: ldap authentication requires the 'xor' digest") return None - return SysAuthenticatorBase.get_challenge(self, ["xor"]) + return super().get_challenge(["xor"]) def check(self, password) -> bool: log("check(%s)", obsc(password)) diff --git a/src/xpra/server/auth/ldap_auth.py b/src/xpra/server/auth/ldap_auth.py index c0a24527b9..5cb3567d5a 100755 --- a/src/xpra/server/auth/ldap_auth.py +++ b/src/xpra/server/auth/ldap_auth.py @@ -36,7 +36,7 @@ def __init__(self, username, **kwargs): self.port = int(kwargs.pop("port", default_port)) self.username_format = kwargs.pop("username_format", "cn=%username, o=%domain") #self.username_format = kwargs.pop("username_format", "%username@%domain") - SysAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) log("ldap auth: host=%s, port=%i, tls=%s, username_format=%s, cacert=%s, encoding=%s", self.host, self.port, self.tls, self.username_format, self.cacert, self.encoding) @@ -53,7 +53,7 @@ def get_challenge(self, digests): if "xor" not in digests: log.error("Error: ldap authentication requires the 'xor' digest") return None - return SysAuthenticatorBase.get_challenge(self, ["xor"]) + return super().get_challenge(["xor"]) def check(self, password) -> bool: log("check(%s)", obsc(password)) diff --git a/src/xpra/server/auth/multifile_auth.py b/src/xpra/server/auth/multifile_auth.py index b51446dae9..c8134c3103 100644 --- a/src/xpra/server/auth/multifile_auth.py +++ b/src/xpra/server/auth/multifile_auth.py @@ -40,7 +40,7 @@ def parse_auth_line(line): class Authenticator(FileAuthenticatorBase): def __init__(self, username, **kwargs): - FileAuthenticatorBase.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.sessions = None def parse_filedata(self, data): diff --git a/src/xpra/server/auth/mysql_auth.py b/src/xpra/server/auth/mysql_auth.py index 276065560d..06fe1b5f54 100755 --- a/src/xpra/server/auth/mysql_auth.py +++ b/src/xpra/server/auth/mysql_auth.py @@ -43,7 +43,7 @@ def db_from_uri(uri): class Authenticator(SQLAuthenticator): def __init__(self, username, uri, **kwargs): - SQLAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.uri = uri def db_cursor(self, *sqlargs): @@ -62,7 +62,7 @@ def __repr__(self): class MySQLDatabaseUtil(DatabaseUtilBase): def __init__(self, uri): - DatabaseUtilBase.__init__(self, uri) + super().__init__(uri) import mysql.connector as mysql #@UnresolvedImport assert mysql.paramstyle=="pyformat" self.param = "%s" diff --git a/src/xpra/server/auth/none_auth.py b/src/xpra/server/auth/none_auth.py index 75698e1c85..d3ab7198a0 100644 --- a/src/xpra/server/auth/none_auth.py +++ b/src/xpra/server/auth/none_auth.py @@ -10,7 +10,7 @@ class Authenticator(SysAuthenticator): def __init__(self, username, **kwargs): - SysAuthenticator.__init__(self, username or get_username(), **kwargs) + super().__init__(username or get_username(), **kwargs) self.salt = None def requires_challenge(self): diff --git a/src/xpra/server/auth/pam_auth.py b/src/xpra/server/auth/pam_auth.py index acf5d4dc51..bad0d6ff9f 100644 --- a/src/xpra/server/auth/pam_auth.py +++ b/src/xpra/server/auth/pam_auth.py @@ -37,7 +37,7 @@ class Authenticator(SysAuthenticator): def __init__(self, username, **kwargs): self.service = kwargs.pop("service", PAM_AUTH_SERVICE) self.check_account = parse_bool("check-account", kwargs.pop("check-account", PAM_CHECK_ACCOUNT), False) - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) def check(self, password) -> bool: log("pam.check(..) pw=%s", self.pw) @@ -49,7 +49,7 @@ def get_challenge(self, digests): if "xor" not in digests: log.error("Error: pam authentication requires the 'xor' digest") return None - return SysAuthenticator.get_challenge(self, ["xor"]) + return super().get_challenge(["xor"]) def __repr__(self): return "PAM" diff --git a/src/xpra/server/auth/password_auth.py b/src/xpra/server/auth/password_auth.py index 8a24eadd3f..7f607c2a2c 100644 --- a/src/xpra/server/auth/password_auth.py +++ b/src/xpra/server/auth/password_auth.py @@ -10,7 +10,7 @@ class Authenticator(SysAuthenticator): def __init__(self, username, **kwargs): self.value = kwargs.pop("value", None) - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.authenticate = self.authenticate_hmac def __repr__(self): diff --git a/src/xpra/server/auth/peercred_auth.py b/src/xpra/server/auth/peercred_auth.py index fbbb4a969c..1649fa54db 100644 --- a/src/xpra/server/auth/peercred_auth.py +++ b/src/xpra/server/auth/peercred_auth.py @@ -77,7 +77,7 @@ def __init__(self, username, **kwargs): except Exception as e: log.error("Error: cannot get peer uid") log.error(" %s", e) - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) def get_uid(self): return self.uid diff --git a/src/xpra/server/auth/sql_auth.py b/src/xpra/server/auth/sql_auth.py index 3e2474c3fc..558c9faa13 100755 --- a/src/xpra/server/auth/sql_auth.py +++ b/src/xpra/server/auth/sql_auth.py @@ -14,7 +14,7 @@ class Authenticator(SQLAuthenticator): def __init__(self, username, uri, **kwargs): - SQLAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.uri = uri def db_cursor(self, *sqlargs): @@ -34,7 +34,7 @@ def __repr__(self): class SQLDatabaseUtil(DatabaseUtilBase): def __init__(self, uri): - DatabaseUtilBase.__init__(self, uri) + super().__init__(uri) #from sqlalchemy import create_engine #@UnresolvedImport #db = create_engine(self.uri) self.param = os.environ.get("PARAMSTYLE", "%s") diff --git a/src/xpra/server/auth/sqlauthbase.py b/src/xpra/server/auth/sqlauthbase.py index 6e1c5a693e..9a0450d2d9 100755 --- a/src/xpra/server/auth/sqlauthbase.py +++ b/src/xpra/server/auth/sqlauthbase.py @@ -16,7 +16,7 @@ def __init__(self, username, **kwargs): self.sessions_query = kwargs.pop("sessions_query", "SELECT uid, gid, displays, env_options, session_options "+ "FROM users WHERE username=(%s) AND password=(%s)") - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.authenticate = self.authenticate_hmac def db_cursor(self, *sqlargs): diff --git a/src/xpra/server/auth/sqlite_auth.py b/src/xpra/server/auth/sqlite_auth.py index a7bdbadd09..7656f4f857 100755 --- a/src/xpra/server/auth/sqlite_auth.py +++ b/src/xpra/server/auth/sqlite_auth.py @@ -15,7 +15,7 @@ class Authenticator(SQLAuthenticator): def __init__(self, username, filename="sqlite.sdb", **kwargs): - SQLAuthenticator.__init__(self, username) + super().__init__(username) if filename and not os.path.isabs(filename): exec_cwd = kwargs.get("exec_cwd", os.getcwd()) filename = os.path.join(exec_cwd, filename) @@ -65,7 +65,7 @@ def parse_session_data(self, data): class SqliteDatabaseUtil(DatabaseUtilBase): def __init__(self, uri): - DatabaseUtilBase.__init__(self, uri) + super().__init__(uri) import sqlite3 assert sqlite3.paramstyle=="qmark" self.param = "?" diff --git a/src/xpra/server/auth/sys_auth_base.py b/src/xpra/server/auth/sys_auth_base.py index f8a8601b33..7ec6eb5af6 100644 --- a/src/xpra/server/auth/sys_auth_base.py +++ b/src/xpra/server/auth/sys_auth_base.py @@ -191,7 +191,7 @@ def get_sessions(self): class SysAuthenticator(SysAuthenticatorBase): def __init__(self, username, **kwargs): - SysAuthenticatorBase.__init__(self, username) + super().__init__(username) self.pw = None if POSIX: try: diff --git a/src/xpra/server/auth/u2f_auth.py b/src/xpra/server/auth/u2f_auth.py index 41af9320b1..ed0277d19d 100755 --- a/src/xpra/server/auth/u2f_auth.py +++ b/src/xpra/server/auth/u2f_auth.py @@ -28,7 +28,7 @@ class Authenticator(SysAuthenticator): def __init__(self, username, **kwargs): self.app_id = kwargs.pop("app_id", APP_ID) key_hexstring = kwargs.pop("public_key", "") - SysAuthenticator.__init__(self, username, **kwargs) + super().__init__(username, **kwargs) self.public_keys = {} key_strs = {} if key_hexstring: diff --git a/src/xpra/server/auth/win32_auth.py b/src/xpra/server/auth/win32_auth.py index 10ad0f3b78..6e40034e49 100644 --- a/src/xpra/server/auth/win32_auth.py +++ b/src/xpra/server/auth/win32_auth.py @@ -33,7 +33,7 @@ def get_gid(self): def get_challenge(self, digests): if "xor" not in digests: raise Exception("win32 authenticator requires the 'xor' digest") - return SysAuthenticator.get_challenge(self, ["xor"]) + return super().get_challenge(["xor"]) def check(self, password) -> bool: token = HANDLE() diff --git a/src/xpra/server/background_worker.py b/src/xpra/server/background_worker.py index b62a49d3da..2759db8fa6 100644 --- a/src/xpra/server/background_worker.py +++ b/src/xpra/server/background_worker.py @@ -20,7 +20,7 @@ class Worker_Thread(Thread): """ def __init__(self): - Thread.__init__(self, name="Worker_Thread") + super().__init__(name="Worker_Thread") self.items = Queue() self.exit = False self.setDaemon(True) diff --git a/src/xpra/server/dbus/dbus_server.py b/src/xpra/server/dbus/dbus_server.py index dbf8856d58..513f92647d 100755 --- a/src/xpra/server/dbus/dbus_server.py +++ b/src/xpra/server/dbus/dbus_server.py @@ -43,7 +43,7 @@ def __init__(self, server=None, extra=""): name = BUS_NAME if extra: name += extra.replace(".", "_").replace(":", "_") - DBUS_Server_Base.__init__(self, bus, server, name) + super().__init__(bus, server, name) self._properties.update({ "idle-timeout" : ("idle_timeout", ni), "server-idle-timeout" : ("server_idle_timeout", ni), diff --git a/src/xpra/server/dbus/dbus_server_base.py b/src/xpra/server/dbus/dbus_server_base.py index 3906b2e216..4e8e5d538a 100755 --- a/src/xpra/server/dbus/dbus_server_base.py +++ b/src/xpra/server/dbus/dbus_server_base.py @@ -19,7 +19,7 @@ class DBUS_Server_Base(dbus.service.Object): def __init__(self, bus, server, name): self.server = server bus_name = dbus.service.BusName(name, bus) - dbus.service.Object.__init__(self, bus_name, PATH) + super().__init__(bus_name, PATH) self.log("(%s)", server) self._properties = {} diff --git a/src/xpra/server/dbus/dbus_source.py b/src/xpra/server/dbus/dbus_source.py index 078059ded9..afd5bf6456 100755 --- a/src/xpra/server/dbus/dbus_source.py +++ b/src/xpra/server/dbus/dbus_source.py @@ -40,7 +40,7 @@ def __init__(self, source=None, extra=""): if extra: name += extra.replace(".", "_").replace(":", "_") bus_name = dbus.service.BusName(name, session_bus) - dbus.service.Object.__init__(self, bus_name, self.path) + super().__init__(bus_name, self.path) self.log("(%s)", source) self._properties = {"bell" : ("send_bell", ni), "cursors" : ("send_cursors", ni), diff --git a/src/xpra/server/gtk_server_base.py b/src/xpra/server/gtk_server_base.py index 7caf635594..8d4f928e34 100644 --- a/src/xpra/server/gtk_server_base.py +++ b/src/xpra/server/gtk_server_base.py @@ -115,7 +115,7 @@ def do_run(self): def make_hello(self, source): - capabilities = ServerBase.make_hello(self, source) + capabilities = super().make_hello(source) if source.wants_display: display = Gdk.Display.get_default() max_size = tuple(display.get_maximal_cursor_size()) @@ -129,7 +129,7 @@ def make_hello(self, source): return capabilities def get_ui_info(self, proto, *args): - info = ServerBase.get_ui_info(self, proto, *args) + info = super().get_ui_info(proto, *args) info.setdefault("server", {}).update({ "display" : Gdk.Display.get_default().get_name(), "root_window_size" : self.get_root_window_size(), @@ -185,7 +185,7 @@ def get_ui_cursor_info(self): def do_get_info(self, proto, *args): start = monotonic_time() - info = ServerBase.do_get_info(self, proto, *args) + info = super().do_get_info(proto, *args) vi = get_gtk_version_info() vi["type"] = "Python/gtk" info.setdefault("server", {}).update(vi) diff --git a/src/xpra/server/http_handler.py b/src/xpra/server/http_handler.py index 09ec11a7ee..f856d2fadc 100644 --- a/src/xpra/server/http_handler.py +++ b/src/xpra/server/http_handler.py @@ -51,7 +51,7 @@ def __init__(self, sock, addr, server = AdHocStruct() server.logger = log self.directory_listing = DIRECTORY_LISTING - BaseHTTPRequestHandler.__init__(self, sock, addr, server) + super().__init__(sock, addr, server) def translate_path(self, path): #code duplicated from superclass since we can't easily inject the web_root.. diff --git a/src/xpra/server/proxy/proxy_dbus_server.py b/src/xpra/server/proxy/proxy_dbus_server.py index 6e32fcae66..b6a167b7a1 100755 --- a/src/xpra/server/proxy/proxy_dbus_server.py +++ b/src/xpra/server/proxy/proxy_dbus_server.py @@ -23,7 +23,7 @@ def __init__(self, server=None): bus = init_system_bus() else: bus = init_session_bus() - DBUS_Server_Base.__init__(self, bus, server, BUS_NAME) + super().__init__(bus, server, BUS_NAME) @dbus.service.method(INTERFACE, in_signature='', out_signature='a{sv}') def GetInfo(self): diff --git a/src/xpra/server/proxy/proxy_instance_thread.py b/src/xpra/server/proxy/proxy_instance_thread.py index 582b8e38a0..ebdeb00c28 100644 --- a/src/xpra/server/proxy/proxy_instance_thread.py +++ b/src/xpra/server/proxy/proxy_instance_thread.py @@ -19,9 +19,9 @@ def __init__(self, session_options, video_encoders, pings, client_proto, server_conn, disp_desc, cipher, encryption_key, caps): - ProxyInstance.__init__(self, session_options, - video_encoders, pings, - disp_desc, cipher, encryption_key, caps) + super().__init__(session_options, + video_encoders, pings, + disp_desc, cipher, encryption_key, caps) self.client_protocol = client_proto self.server_conn = server_conn diff --git a/src/xpra/server/proxy/proxy_server.py b/src/xpra/server/proxy/proxy_server.py index 3c2b54398b..8eef637d3b 100644 --- a/src/xpra/server/proxy/proxy_server.py +++ b/src/xpra/server/proxy/proxy_server.py @@ -197,7 +197,7 @@ def verify_connection_accepted(self, protocol): self.send_disconnect(protocol, LOGIN_TIMEOUT) def hello_oked(self, proto, packet, c, auth_caps): - if ServerCore.hello_oked(self, proto, packet, c, auth_caps): + if super().hello_oked(proto, packet, c, auth_caps): #already handled in superclass return self.accept_client(proto, c) diff --git a/src/xpra/server/window/window_source.py b/src/xpra/server/window/window_source.py index bd1d182ba6..1920f014c1 100644 --- a/src/xpra/server/window/window_source.py +++ b/src/xpra/server/window/window_source.py @@ -133,7 +133,7 @@ def __init__(self, rgb_formats, default_encoding_options, mmap, mmap_size, bandwidth_limit, jitter): - WindowIconSource.__init__(self, window_icon_encodings, icons_encoding_options) + super().__init__(window_icon_encodings, icons_encoding_options) self.idle_add = idle_add self.timeout_add = timeout_add self.source_remove = source_remove diff --git a/src/xpra/server/window/window_video_source.py b/src/xpra/server/window/window_video_source.py index 0e4b30dd81..7354f20cba 100644 --- a/src/xpra/server/window/window_video_source.py +++ b/src/xpra/server/window/window_video_source.py @@ -105,7 +105,7 @@ def __init__(self, *args): #this will call init_vars(): self.supports_scrolling = False self.video_subregion = None - WindowSource.__init__(self, *args) + super().__init__(*args) self.supports_eos = self.encoding_options.boolget("eos") self.scroll_encoding = SCROLL_ENCODING self.supports_scrolling = self.scroll_encoding and self.encoding_options.boolget("scrolling") and not STRICT_MODE @@ -169,7 +169,7 @@ def init_vars(self): self.last_scroll_time = 0 def do_set_auto_refresh_delay(self, min_delay, delay): - WindowSource.do_set_auto_refresh_delay(self, min_delay, delay) + super().do_set_auto_refresh_delay(min_delay, delay) r = self.video_subregion if r: r.set_auto_refresh_delay(self.base_auto_refresh_delay) @@ -349,7 +349,7 @@ def set_new_encoding(self, encoding, strict=None): if self.encoding!=encoding: #ensure we re-init the codecs asap: self.cleanup_codecs() - WindowSource.set_new_encoding(self, encoding, strict) + super().set_new_encoding(encoding, strict) def update_encoding_selection(self, encoding=None, exclude=None, init=False): #override so we don't use encodings that don't have valid csc modes: @@ -371,7 +371,7 @@ def update_encoding_selection(self, encoding=None, exclude=None, init=False): self.common_video_encodings = [x for x in PREFERED_ENCODING_ORDER if x in self.video_encodings and x in self.core_encodings] log("update_encoding_options: common_video_encodings=%s, csc_encoder=%s, video_encoder=%s", self.common_video_encodings, self._csc_encoder, self._video_encoder) - WindowSource.update_encoding_selection(self, encoding, exclude, init) + super().update_encoding_selection(encoding, exclude, init) def do_set_client_properties(self, properties): #client may restrict csc modes for specific windows @@ -380,7 +380,7 @@ def do_set_client_properties(self, properties): self.video_subregion.supported = properties.boolget("encoding.video_subregion", VIDEO_SUBREGION) and VIDEO_SUBREGION if properties.get("scaling.control") is not None: self.scaling_control = max(0, min(100, properties.intget("scaling.control", 0))) - WindowSource.do_set_client_properties(self, properties) + super().do_set_client_properties(properties) #encodings may have changed, so redo this: nv_common = (set(self.server_core_encodings) & set(self.core_encodings)) - set(self.video_encodings) self.non_video_encodings = [x for x in PREFERED_ENCODING_ORDER if x in nv_common] @@ -539,7 +539,7 @@ def do_damage(self, ww, wh, x, y, w, h, options): if r and r.intersects(x, y, w, h): #the damage will take care of scheduling it again vs.cancel_refresh_timer() - WindowSource.do_damage(self, ww, wh, x, y, w, h, options) + super().do_damage(ww, wh, x, y, w, h, options) def cancel_damage(self): @@ -570,16 +570,16 @@ def full_quality_refresh(self, damage_options): if self.non_video_encodings: #refresh the whole window in one go: damage_options["novideo"] = True - WindowSource.full_quality_refresh(self, damage_options) + super().full_quality_refresh(damage_options) def quality_changed(self, window, *args): - WindowSource.quality_changed(self, window, args) + super().quality_changed(window, args) self.video_context_clean() return True def speed_changed(self, window, *args): - WindowSource.speed_changed(self, window, args) + super().speed_changed(window, args) self.video_context_clean() return True @@ -587,18 +587,18 @@ def speed_changed(self, window, *args): def must_batch(self, delay): #force batching when using video region #because the video region code is in the send_delayed path - return self.video_subregion.rectangle is not None or WindowSource.must_batch(self, delay) + return self.video_subregion.rectangle is not None or super().must_batch(delay) def get_speed(self, encoding): - s = WindowSource.get_speed(self, encoding) + s = super().get_speed(encoding) #give a boost if we have a video region and this is not video: if self.video_subregion.rectangle and encoding not in self.video_encodings: s += 25 return min(100, s) def get_quality(self, encoding): - q = WindowSource.get_quality(self, encoding) + q = super().get_quality(encoding) #give a boost if we have a video region and this is not video: if self.video_subregion.rectangle and encoding not in self.video_encodings: q += 40 @@ -608,7 +608,7 @@ def get_quality(self, encoding): def client_decode_error(self, error, message): #maybe the stream is now corrupted.. self.cleanup_codecs() - WindowSource.client_decode_error(self, error, message) + super().client_decode_error(error, message) def get_refresh_exclude(self): @@ -626,7 +626,7 @@ def refresh_subregion(self, regions): self.flush_video_encoder_now() encoding = self.auto_refresh_encodings[0] options = self.get_refresh_options() - WindowSource.do_send_delayed_regions(self, now, regions, encoding, options, get_best_encoding=self.get_refresh_subregion_encoding) + super().do_send_delayed_regions(now, regions, encoding, options, get_best_encoding=self.get_refresh_subregion_encoding) return True def get_refresh_subregion_encoding(self, *_args): @@ -640,7 +640,7 @@ def get_refresh_subregion_encoding(self, *_args): def remove_refresh_region(self, region): #override so we can update the subregion timers / regions tracking: - WindowSource.remove_refresh_region(self, region) + super().remove_refresh_region(region) self.video_subregion.remove_refresh_region(region) def add_refresh_region(self, region): @@ -651,7 +651,7 @@ def add_refresh_region(self, region): vr = self.video_subregion.rectangle if vr is None: #no video region, normal code path: - return WindowSource.add_refresh_region(self, region) + return super().add_refresh_region(region) if vr.contains_rect(region): #all of it is in the video region: self.video_subregion.add_video_refresh(region) @@ -659,12 +659,12 @@ def add_refresh_region(self, region): ir = vr.intersection_rect(region) if ir is None: #region is outside video region, normal code path: - return WindowSource.add_refresh_region(self, region) + return super().add_refresh_region(region) #add intersection (rectangle in video region) to video refresh: self.video_subregion.add_video_refresh(ir) #add any rectangles not in the video region #(if any: keep track if we actually added anything) - return sum(WindowSource.add_refresh_region(self, r) for r in region.substract_rect(vr)) + return sum(super().add_refresh_region(r) for r in region.substract_rect(vr)) def matches_video_subregion(self, width, height): vr = self.video_subregion.rectangle @@ -707,7 +707,7 @@ def send_nonvideo(regions=regions, encoding=coding, exclude_region=None, get_bes if self.b_frame_flush_timer and exclude_region is None: #a b-frame is already due, don't clobber it! exclude_region = vr - WindowSource.do_send_delayed_regions(self, damage_time, regions, encoding, options, exclude_region=exclude_region, get_best_encoding=get_best_encoding) + super().do_send_delayed_regions(damage_time, regions, encoding, options, exclude_region=exclude_region, get_best_encoding=get_best_encoding) if self.is_tray: sublog("BUG? video for tray - don't use video region!") @@ -727,7 +727,7 @@ def send_nonvideo(regions=regions, encoding=coding, exclude_region=None, get_bes if not vr: sublog("no video region, we may use the video encoder for something else") - WindowSource.do_send_delayed_regions(self, damage_time, regions, coding, options) + super().do_send_delayed_regions(damage_time, regions, coding, options) return assert not self.full_frames_only @@ -1023,7 +1023,7 @@ def update_encoding_options(self, force_reload=False): Can be called from any thread. """ - WindowSource.update_encoding_options(self, force_reload) + super().update_encoding_options(force_reload) vs = self.video_subregion if vs: if (self.encoding!="auto" and self.encoding not in self.common_video_encodings) or \ @@ -1064,8 +1064,8 @@ def update_encoding_options(self, force_reload=False): #we don't bother substracting new and old (too complicated) refreshlog("scheduling refresh of old region: %s", old) #this may also schedule a refresh: - WindowSource.add_refresh_region(self, old) - WindowSource.remove_refresh_region(self, newrect) + super().add_refresh_region(old) + super().remove_refresh_region(newrect) if not self.refresh_regions: self.cancel_refresh_timer() if subregion_needs_refresh: @@ -1720,13 +1720,13 @@ def get_fail_cb(self, packet): coding = packet[6] if coding in self.common_video_encodings: return None - return WindowSource.get_fail_cb(self, packet) + return super().get_fail_cb(packet) def make_draw_packet(self, x, y, w, h, coding, data, outstride, client_options, options): #overriden so we can invalidate the scroll data: #log.error("make_draw_packet%s", (x, y, w, h, coding, "..", outstride, client_options) - packet = WindowSource.make_draw_packet(self, x, y, w, h, coding, data, outstride, client_options, options) + packet = super().make_draw_packet(x, y, w, h, coding, data, outstride, client_options, options) sd = self.scroll_data if sd and not options.get("scroll"): if client_options.get("scaled_size") or client_options.get("quality", 100)<20: @@ -1944,7 +1944,7 @@ def do_schedule_auto_refresh(self, encoding, data, region, client_options, optio #if there are non-scroll packets following this one, they will #and if not then we're OK anyway return - WindowSource.do_schedule_auto_refresh(self, encoding, data, region, client_options, options) + super().do_schedule_auto_refresh(encoding, data, region, client_options, options) def get_fallback_encoding(self, encodings, order): diff --git a/src/xpra/sound/sink.py b/src/xpra/sound/sink.py index bc8b783256..fd3b81f535 100755 --- a/src/xpra/sound/sink.py +++ b/src/xpra/sound/sink.py @@ -77,7 +77,7 @@ def __init__(self, sink_type=None, sink_options=None, codecs=(), codec_options=N csv(codecs), csv(get_decoders().keys()))) codec = matching[0] decoder, parser, stream_compressor = get_decoder_elements(codec) - SoundPipeline.__init__(self, codec) + super().__init__(codec) self.container_format = (parser or "").replace("demux", "").replace("depay", "") self.sink_type = sink_type self.stream_compressor = stream_compressor diff --git a/src/xpra/sound/src.py b/src/xpra/sound/src.py index 4d1278c920..e65fe61094 100755 --- a/src/xpra/sound/src.py +++ b/src/xpra/sound/src.py @@ -81,7 +81,7 @@ def __init__(self, src_type=None, src_options=None, codecs=(), codec_options=Non raise InitExit(1, "no matching codecs between arguments '%s' and supported list '%s'" % (csv(codecs), csv(get_encoders().keys()))) codec = matching[0] encoder, fmt, stream_compressor = get_encoder_elements(codec) - SoundPipeline.__init__(self, codec) + super().__init__(codec) self.queue = None self.caps = None self.volume = None diff --git a/src/xpra/sound/wrapper.py b/src/xpra/sound/wrapper.py index bd425d2018..ae749528d3 100644 --- a/src/xpra/sound/wrapper.py +++ b/src/xpra/sound/wrapper.py @@ -87,7 +87,7 @@ def __init__(self, wrapped_object, method_whitelist, exports_list): #add bits common to both record and play: methods = method_whitelist+["set_volume", "cleanup"] exports = ["state-changed", "info", "error"] + exports_list - subprocess_callee.__init__(self, wrapped_object=wrapped_object, method_whitelist=methods) + super().__init__(wrapped_object=wrapped_object, method_whitelist=methods) for x in exports: self.connect_export(x) @@ -103,7 +103,7 @@ def process_exit(): def force_exit(): sys.exit(1) self.timeout_add(FAKE_CRASH*1000, force_exit) - subprocess_callee.start(self) + super().start(self) def cleanup(self): wo = self.wrapped_object @@ -126,7 +126,7 @@ class sound_record(sound_subprocess): def __init__(self, *pipeline_args): from xpra.sound.src import SoundSource sound_pipeline = SoundSource(*pipeline_args) - sound_subprocess.__init__(self, sound_pipeline, [], ["new-stream", "new-buffer"]) + super().__init__(sound_pipeline, [], ["new-stream", "new-buffer"]) self.large_packets = [b"new-buffer"] class sound_play(sound_subprocess): @@ -134,7 +134,7 @@ class sound_play(sound_subprocess): def __init__(self, *pipeline_args): from xpra.sound.sink import SoundSink sound_pipeline = SoundSink(*pipeline_args) - sound_subprocess.__init__(self, sound_pipeline, ["add_data"], []) + super().__init__(sound_pipeline, ["add_data"], []) def run_sound(mode, error_cb, options, args): @@ -236,7 +236,7 @@ class sound_subprocess_wrapper(subprocess_caller): * forward get/set volume calls (get_volume uses the value found in "info") """ def __init__(self, description): - subprocess_caller.__init__(self, description) + super().__init__(description) self.state = "stopped" self.codec = "unknown" self.codec_description = "" @@ -315,7 +315,7 @@ def get_volume(self): class source_subprocess_wrapper(sound_subprocess_wrapper): def __init__(self, plugin, options, codecs, volume, element_options): - sound_subprocess_wrapper.__init__(self, "sound source") + super().__init__("sound source") self.large_packets = [b"new-buffer"] self.command = get_full_sound_command()+[ "_sound_record", "-", "-", @@ -338,7 +338,7 @@ def __repr__(self): class sink_subprocess_wrapper(sound_subprocess_wrapper): def __init__(self, plugin, codec, volume, element_options): - sound_subprocess_wrapper.__init__(self, "sound output") + super().__init__("sound output") self.large_packets = [b"add_data"] self.codec = codec self.command = get_full_sound_command()+[ diff --git a/src/xpra/x11/gtk_x11/clipboard.py b/src/xpra/x11/gtk_x11/clipboard.py index 86fd54f27d..604ca9ba71 100644 --- a/src/xpra/x11/gtk_x11/clipboard.py +++ b/src/xpra/x11/gtk_x11/clipboard.py @@ -76,7 +76,7 @@ def __init__(self, send_packet_cb, progress_cb=None, **kwargs): self.init_window() init_x11_filter() self.x11_filter = True - ClipboardTimeoutHelper.__init__(self, send_packet_cb, progress_cb, **kwargs) + super().__init__(send_packet_cb, progress_cb, **kwargs) def __repr__(self): return "X11Clipboard" @@ -174,12 +174,12 @@ def do_xpra_property_notify_event(self, event): def _munge_raw_selection_to_wire(self, target, dtype, dformat, data): if dformat==32 and dtype in ("ATOM", "ATOM_PAIR"): return "atoms", _filter_targets(xatoms_to_strings(data)) - return ClipboardProtocolHelperCore._munge_raw_selection_to_wire(self, target, dtype, dformat, data) + return super()._munge_raw_selection_to_wire(target, dtype, dformat, data) def _munge_wire_selection_to_raw(self, encoding, dtype, dformat, data): if encoding=="atoms": return strings_to_xatoms(_filter_targets(data)) - return ClipboardProtocolHelperCore._munge_wire_selection_to_raw(self, encoding, dtype, dformat, data) + return super()._munge_wire_selection_to_raw(encoding, dtype, dformat, data) GObject.type_register(X11Clipboard) diff --git a/src/xpra/x11/models/base.py b/src/xpra/x11/models/base.py index 7194107e90..f5729a4514 100644 --- a/src/xpra/x11/models/base.py +++ b/src/xpra/x11/models/base.py @@ -646,4 +646,4 @@ def update_wm_state(prop): # it may make sense to apply it to the client_window # whereas the code in WindowModel assumes there is a corral window #not handled: - return CoreX11WindowModel.process_client_message_event(self, event) + return super().process_client_message_event(event) diff --git a/src/xpra/x11/models/window.py b/src/xpra/x11/models/window.py index fc4699758e..d8ea9e9192 100644 --- a/src/xpra/x11/models/window.py +++ b/src/xpra/x11/models/window.py @@ -335,7 +335,7 @@ def do_unmanaged(self, wm_exiting): self.client_window.show_unraised() #it is now safe to destroy the corral window: cwin.destroy() - BaseWindowModel.do_unmanaged(self, wm_exiting) + super().do_unmanaged(wm_exiting) ######################################### @@ -366,7 +366,7 @@ def map(self): def do_xpra_property_notify_event(self, event): if event.delivered_to is self.corral_window: return - BaseWindowModel.do_xpra_property_notify_event(self, event) + super().do_xpra_property_notify_event(event) def do_child_map_request_event(self, event): # If we get a MapRequest then it might mean that someone tried to map @@ -621,7 +621,7 @@ def process_client_message_event(self, event): with xswallow: X11Window.configureAndNotify(self.xid, x, y, w, h) return True - return BaseWindowModel.process_client_message_event(self, event) + return super().process_client_message_event(event) def calc_constrained_size(self, w, h, hints): mhints = typedict(hints) diff --git a/src/xpra/x11/server.py b/src/xpra/x11/server.py index 91487734b3..70a62f9337 100644 --- a/src/xpra/x11/server.py +++ b/src/xpra/x11/server.py @@ -320,12 +320,12 @@ def get_server_mode(self): def server_event(self, *args): - X11ServerBase.server_event(self, *args) + super().server_event(*args) self.emit("server-event", args) def make_hello(self, source): - capabilities = X11ServerBase.make_hello(self, source) + capabilities = super().make_hello(source) if source.wants_features: capabilities["pointer.grabs"] = True updict(capabilities, "window", { @@ -347,7 +347,7 @@ def make_hello(self, source): # info: # def do_get_info(self, proto, server_sources): - info = X11ServerBase.do_get_info(self, proto, server_sources) + info = super().do_get_info(proto, server_sources) info.setdefault("state", {}).update({ "focused" : self._has_focus, "grabbed" : self._has_grab, @@ -355,7 +355,7 @@ def do_get_info(self, proto, server_sources): return info def get_ui_info(self, proto, wids=None, *args): - info = X11ServerBase.get_ui_info(self, proto, wids, *args) + info = super().get_ui_info(proto, wids, *args) #_NET_WM_NAME: wm = self._wm if wm: @@ -363,7 +363,7 @@ def get_ui_info(self, proto, wids=None, *args): return info def get_window_info(self, window): - info = X11ServerBase.get_window_info(self, window) + info = super().get_window_info(window) info.update({ "focused" : self._has_focus and self._window_to_id.get(window, -1)==self._has_focus, "grabbed" : self._has_grab and self._window_to_id.get(window, -1)==self._has_grab, @@ -1057,7 +1057,7 @@ def _set_client_properties(self, proto, wid, window, new_client_properties): #we have handled it on the window directly, so remove it from client properties del new_client_properties["workspace"] #handle the rest as normal: - X11ServerBase._set_client_properties(self, proto, wid, window, new_client_properties) + super()._set_client_properties(proto, wid, window, new_client_properties) """ override so we can raise the window under the cursor @@ -1072,7 +1072,7 @@ def _move_pointer(self, wid, pos, *args): mouselog("raising %s", window) with xswallow: window.raise_window() - X11ServerBase._move_pointer(self, wid, pos, *args) + super()._move_pointer(wid, pos, *args) def _process_close_window(self, proto, packet): diff --git a/src/xpra/x11/server_keyboard_config.py b/src/xpra/x11/server_keyboard_config.py index a5e150a4d7..829a5b74ea 100644 --- a/src/xpra/x11/server_keyboard_config.py +++ b/src/xpra/x11/server_keyboard_config.py @@ -133,7 +133,7 @@ def get_info(self) -> dict: def parse_options(self, props): """ used by both process_hello and process_keymap to set the keyboard attributes """ - KeyboardConfigBase.parse_options(self, props) + super().parse_options(props) modded = {} def parse_option(name, parse_fn, *parse_args): prop = "xkbmap_%s" % name diff --git a/src/xpra/x11/uinput_device.py b/src/xpra/x11/uinput_device.py index a0f3a6559f..b83b0d38e8 100644 --- a/src/xpra/x11/uinput_device.py +++ b/src/xpra/x11/uinput_device.py @@ -144,7 +144,7 @@ def move_pointer(self, screen_no, x, y, *_args): class UInputTouchpadDevice(UInputDevice): def __init__(self, device, device_path, root_w, root_h): - UInputDevice.__init__(self, device, device_path) + super().__init__(device, device_path) self.root_w = root_w self.root_h = root_h diff --git a/src/xpra/x11/x11_server_base.py b/src/xpra/x11/x11_server_base.py index 4aee77c909..ebceda0476 100644 --- a/src/xpra/x11/x11_server_base.py +++ b/src/xpra/x11/x11_server_base.py @@ -63,7 +63,7 @@ def __init__(self, clobber): self.display_pid = 0 def do_init(self, opts): - X11ServerCore.do_init(self, opts) + super().do_init(opts) self._xsettings_enabled = opts.xsettings if self._xsettings_enabled: from xpra.x11.xsettings import XSettingsHelper diff --git a/src/xpra/x11/x11_server_core.py b/src/xpra/x11/x11_server_core.py index e8f0530752..15d8507f80 100644 --- a/src/xpra/x11/x11_server_core.py +++ b/src/xpra/x11/x11_server_core.py @@ -347,7 +347,7 @@ def set_keyboard_repeat(self, key_repeat): keylog("keyboard repeat disabled") def make_hello(self, source): - capabilities = GTKServerBase.make_hello(self, source) + capabilities = super().make_hello(source) capabilities["server_type"] = "Python/gtk/x11" if source.wants_features: capabilities.update({ @@ -368,7 +368,7 @@ def make_hello(self, source): def do_get_info(self, proto, server_sources): start = monotonic_time() - info = GTKServerBase.do_get_info(self, proto, server_sources) + info = super().do_get_info(proto, server_sources) if self.opengl_props: info["opengl"] = self.opengl_props sinfo = info.setdefault("server", {}) @@ -382,7 +382,7 @@ def do_get_info(self, proto, server_sources): def get_ui_info(self, proto, wids=None, *args): log("do_get_info thread=%s", threading.current_thread()) - info = GTKServerBase.get_ui_info(self, proto, wids, *args) + info = super().get_ui_info(proto, wids, *args) #this is added here because the server keyboard config doesn't know about "keys_pressed".. if not self.readonly: with xlog: