From a70e9766b950228a1ee72a8f4186fb2adbc00c8a Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 16 Nov 2022 19:50:17 -0500 Subject: [PATCH 1/2] Explicit arguments with *args and **kwargs --- Xlib/display.py | 4 ++-- Xlib/ext/record.py | 4 ++-- Xlib/ext/shape.py | 6 +++--- Xlib/protocol/request.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Xlib/display.py b/Xlib/display.py index e0f7b5c8..4ec2c089 100644 --- a/Xlib/display.py +++ b/Xlib/display.py @@ -66,9 +66,9 @@ class _BaseDisplay(protocol_display.Display): # Implement a cache of atom names, used by Window objects when # dealing with some ICCCM properties not defined in Xlib.Xatom - def __init__(self, *args, **keys): + def __init__(self, display = None, *args, **kwargs): self.resource_classes = _resource_baseclasses.copy() - protocol_display.Display.__init__(self, *args, **keys) + protocol_display.Display.__init__(self, display, *args, **kwargs) self._atom_cache = {} def get_atom(self, atomname, only_if_exists=0): diff --git a/Xlib/ext/record.py b/Xlib/ext/record.py index bb53ec19..df8c9938 100644 --- a/Xlib/ext/record.py +++ b/Xlib/ext/record.py @@ -215,9 +215,9 @@ class EnableContext(rq.ReplyRequest): # See the discussion on ListFonstsWithInfo in request.py - def __init__(self, callback, *args, **keys): + def __init__(self, callback, display, *args, defer = False, **keys): self._callback = callback - rq.ReplyRequest.__init__(self, *args, **keys) + rq.ReplyRequest.__init__(self, display, *args, defer=defer, **keys) def _parse_response(self, data): r, d = self._reply.parse_binary(data, self._display) diff --git a/Xlib/ext/shape.py b/Xlib/ext/shape.py index 05a517ac..55b2bc41 100644 --- a/Xlib/ext/shape.py +++ b/Xlib/ext/shape.py @@ -220,7 +220,7 @@ def get_rectangles(self, source_kind): source_kind=source_kind, ) -def input_selected(self, ): +def input_selected(self): return InputSelected( display=self.display, opcode=self.display.get_extension_major(extname), @@ -249,14 +249,14 @@ def offset(self, destination_kind, x_offset, y_offset): y_offset=y_offset, ) -def query_extents(self, ): +def query_extents(self): return QueryExtents( display=self.display, opcode=self.display.get_extension_major(extname), destination_window=self, ) -def query_version(self, ): +def query_version(self): return QueryVersion( display=self.display, opcode=self.display.get_extension_major(extname), diff --git a/Xlib/protocol/request.py b/Xlib/protocol/request.py index b431e137..6d2b89cd 100644 --- a/Xlib/protocol/request.py +++ b/Xlib/protocol/request.py @@ -785,9 +785,9 @@ class ListFontsWithInfo(rq.ReplyRequest): # Bastards. - def __init__(self, *args, **keys): + def __init__(self, display, defer = False, *args, **keys): self._fonts = [] - rq.ReplyRequest.__init__(self, *args, **keys) + rq.ReplyRequest.__init__(self, display, defer, *args, **keys) def _parse_response(self, data): From aa61d8082203895cef6e1dd36ba85afb63bdf4e5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 18 Nov 2022 15:12:06 -0500 Subject: [PATCH 2/2] argument order --- Xlib/display.py | 4 ++-- Xlib/ext/record.py | 4 ++-- Xlib/protocol/request.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Xlib/display.py b/Xlib/display.py index 4ec2c089..65df12db 100644 --- a/Xlib/display.py +++ b/Xlib/display.py @@ -66,9 +66,9 @@ class _BaseDisplay(protocol_display.Display): # Implement a cache of atom names, used by Window objects when # dealing with some ICCCM properties not defined in Xlib.Xatom - def __init__(self, display = None, *args, **kwargs): + def __init__(self, display = None): self.resource_classes = _resource_baseclasses.copy() - protocol_display.Display.__init__(self, display, *args, **kwargs) + protocol_display.Display.__init__(self, display) self._atom_cache = {} def get_atom(self, atomname, only_if_exists=0): diff --git a/Xlib/ext/record.py b/Xlib/ext/record.py index df8c9938..ce0d448a 100644 --- a/Xlib/ext/record.py +++ b/Xlib/ext/record.py @@ -215,9 +215,9 @@ class EnableContext(rq.ReplyRequest): # See the discussion on ListFonstsWithInfo in request.py - def __init__(self, callback, display, *args, defer = False, **keys): + def __init__(self, callback, display, defer = False, *args, **keys): self._callback = callback - rq.ReplyRequest.__init__(self, display, *args, defer=defer, **keys) + rq.ReplyRequest.__init__(self, display, defer=defer, *args, **keys) def _parse_response(self, data): r, d = self._reply.parse_binary(data, self._display) diff --git a/Xlib/protocol/request.py b/Xlib/protocol/request.py index 6d2b89cd..cfd4f3b4 100644 --- a/Xlib/protocol/request.py +++ b/Xlib/protocol/request.py @@ -787,7 +787,7 @@ class ListFontsWithInfo(rq.ReplyRequest): def __init__(self, display, defer = False, *args, **keys): self._fonts = [] - rq.ReplyRequest.__init__(self, display, defer, *args, **keys) + rq.ReplyRequest.__init__(self, display, defer=defer, *args, **keys) def _parse_response(self, data): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy