Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/x11/common.py : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Xpra.
2# Copyright (C) 2017-2020 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
7class Unmanageable(Exception):
8 pass
11REPR_FUNCTIONS = {}
14# Just to make it easier to pass around and have a helpful debug logging.
15# Really, just a python objects where we can stick random bags of attributes.
16class X11Event:
17 def __init__(self, name):
18 self.name = name
20 def __repr__(self):
21 d = {}
22 for k,v in self.__dict__.items():
23 if k in ("name", "display", "type"):
24 continue
25 if k=="serial":
26 d[k] = "%#x" % v
27 else:
28 fn = REPR_FUNCTIONS.get(type(v), str)
29 d[k] = fn(v)
30 return "<X11:%s %r>" % (self.name, d)