[arch-commits] Commit in python-xpybutil/trunk (PKGBUILD xcffib-compat.patch)
Felix Yan
fyan at archlinux.org
Sun Sep 20 08:31:39 UTC 2015
Date: Sunday, September 20, 2015 @ 10:31:39
Author: fyan
Revision: 141210
upgpkg: python-xpybutil 0.0.1.20150328-2
update patch to handle exception gracefully
Modified:
python-xpybutil/trunk/PKGBUILD
python-xpybutil/trunk/xcffib-compat.patch
---------------------+
PKGBUILD | 4 +-
xcffib-compat.patch | 96 +++++++++++++++++++++++++++++++++-----------------
2 files changed, 67 insertions(+), 33 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-09-20 08:29:34 UTC (rev 141209)
+++ PKGBUILD 2015-09-20 08:31:39 UTC (rev 141210)
@@ -5,7 +5,7 @@
pkgname=python2-xpybutil
pkgver=0.0.1.20150328
_commit=8ee7dc406aabb3d54f38e692bf068b1b61131d83
-pkgrel=1
+pkgrel=2
pkgdesc="An incomplete xcb-util port plus some extras"
arch=('any')
url="https://github.com/BurntSushi/xpybutil"
@@ -14,7 +14,7 @@
source=("git+https://github.com/BurntSushi/xpybutil.git#commit=$_commit"
xcffib-compat.patch)
md5sums=('SKIP'
- '6623c64e52c5753d759ef3f4ff6a8a87')
+ 'b5bf6cac28a2546152229fcb77599dd5')
prepare() {
cd "$srcdir/xpybutil"
Modified: xcffib-compat.patch
===================================================================
--- xcffib-compat.patch 2015-09-20 08:29:34 UTC (rev 141209)
+++ xcffib-compat.patch 2015-09-20 08:31:39 UTC (rev 141210)
@@ -1,8 +1,28 @@
-commit 78424375f3733394f84f8b4b6663f961402951ff
-Author: Felix Yan <felixonmars at archlinux.org>
-Date: Wed Sep 16 17:13:46 2015 +0800
+From 6e2b96ccb04212096f8faca772ed7dc5a2d20e43 Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars at archlinux.org>
+Date: Wed, 16 Sep 2015 17:13:46 +0800
+Subject: [PATCH] Add support for xcffib
- Add support for xcffib
+---
+ examples/window-marker.py | 6 +-
+ setup.py | 6 +-
+ xpybutil/__init__.py | 5 +-
+ xpybutil/compat.py | 17 +++++
+ xpybutil/event.py | 5 +-
+ xpybutil/ewmh.py | 176 +++++++++++++++++++++++-----------------------
+ xpybutil/font.py | 6 +-
+ xpybutil/icccm.py | 54 +++++++-------
+ xpybutil/image.py | 6 +-
+ xpybutil/keybind.py | 2 +-
+ xpybutil/motif.py | 4 +-
+ xpybutil/mousebind.py | 2 +-
+ xpybutil/rect.py | 4 +-
+ xpybutil/render.py | 12 ++--
+ xpybutil/util.py | 6 +-
+ xpybutil/window.py | 8 +--
+ xpybutil/xinerama.py | 4 +-
+ 17 files changed, 170 insertions(+), 153 deletions(-)
+ create mode 100644 xpybutil/compat.py
diff --git a/examples/window-marker.py b/examples/window-marker.py
index e345656..01f3998 100644
@@ -60,26 +80,27 @@
setup(
diff --git a/xpybutil/__init__.py b/xpybutil/__init__.py
-index 8ec1eda..af58027 100644
+index 8ec1eda..a10886e 100644
--- a/xpybutil/__init__.py
+++ b/xpybutil/__init__.py
-@@ -1,4 +1,4 @@
+@@ -1,9 +1,8 @@
-import xcb, xcb.xproto
-+from xpybutil.compat import xcb
++from xpybutil.compat import xcb, xcb_ConnectException
try:
conn = xcb.connect()
-@@ -6,4 +6,3 @@ try:
- except xcb.ConnectException:
+ root = conn.get_setup().roots[0].root
+-except xcb.ConnectException:
++except xcb_ConnectException:
conn = None
root = None
-
diff --git a/xpybutil/compat.py b/xpybutil/compat.py
new file mode 100644
-index 0000000..66efa58
+index 0000000..d06130e
--- /dev/null
+++ b/xpybutil/compat.py
-@@ -0,0 +1,13 @@
+@@ -0,0 +1,17 @@
+try:
+ import xcffib as xcb
+ import xcffib.xproto as xproto
@@ -86,6 +107,8 @@
+ import xcffib.xinerama as xinerama
+ import xcffib.randr as randr
+ import xcffib.render as render
++ from xcffib import XcffibException as xcb_Exception
++ from xcffib import ConnectionException as xcb_ConnectException
+
+except ImportError:
+ import xcb
@@ -93,25 +116,36 @@
+ import xcb.xinerama as xinerama
+ import xcb.randr as randr
+ import xcb.render as render
++ from xcb import Exception as xcb_Exception
++ from xcb import ConnectException as xcb_ConnectException
diff --git a/xpybutil/event.py b/xpybutil/event.py
-index c161874..15f636e 100644
+index c161874..06b47db 100644
--- a/xpybutil/event.py
+++ b/xpybutil/event.py
-@@ -8,8 +8,7 @@ import struct
+@@ -8,8 +8,7 @@
import sys
import traceback
-import xcb
-import xcb.xproto as xproto
-+from xpybutil.compat import xcb, xproto
++from xpybutil.compat import xcb_Exception, xproto
from xpybutil import conn, root, util
+@@ -150,7 +149,7 @@ def main():
+ key = (e.__class__, w)
+ for cb in __callbacks.get(key, []):
+ cb(e)
+- except xcb.Exception:
++ except xcb_Exception:
+ traceback.print_exc()
+ sys.exit(1)
+
diff --git a/xpybutil/ewmh.py b/xpybutil/ewmh.py
index a4f0977..c101555 100644
--- a/xpybutil/ewmh.py
+++ b/xpybutil/ewmh.py
-@@ -72,7 +72,7 @@ spec :-)
+@@ -72,7 +72,7 @@
"""
import struct
@@ -818,7 +852,7 @@
index 8190620..68b448f 100644
--- a/xpybutil/font.py
+++ b/xpybutil/font.py
-@@ -5,18 +5,18 @@ yourself wanting to use this module, you're probably doing something wrong.
+@@ -5,18 +5,18 @@
This module will likely be removed in the future.
"""
@@ -844,7 +878,7 @@
index a7ccfb8..d232ebb 100644
--- a/xpybutil/icccm.py
+++ b/xpybutil/icccm.py
-@@ -8,7 +8,7 @@ to this module.
+@@ -8,7 +8,7 @@
from collections import defaultdict
import struct
@@ -892,7 +926,7 @@
atoms.WM_ICON_NAME, atoms.STRING, 8,
len(wm_icon_name), wm_icon_name)
-@@ -126,7 +126,7 @@ class NormalHintsCookie(util.PropertyCookie):
+@@ -126,7 +126,7 @@ def reply(self):
return
if f == 'win_gravity' and v[i] <= 0:
@@ -1096,7 +1130,7 @@
index 5326f06..00912e1 100644
--- a/xpybutil/keybind.py
+++ b/xpybutil/keybind.py
-@@ -10,7 +10,7 @@ if you're getting down and dirty.
+@@ -10,7 +10,7 @@
from collections import defaultdict
import sys
@@ -1109,7 +1143,7 @@
index 56aeb36..58fa202 100644
--- a/xpybutil/motif.py
+++ b/xpybutil/motif.py
-@@ -5,7 +5,7 @@ toggling window decorations via events.
+@@ -5,7 +5,7 @@
"""
import struct
@@ -1131,7 +1165,7 @@
index 6c5fef5..60609b7 100644
--- a/xpybutil/mousebind.py
+++ b/xpybutil/mousebind.py
-@@ -11,7 +11,7 @@ TODO: Mouse bindings that hook into the event dipatcher like the keybind
+@@ -11,7 +11,7 @@
"""
from collections import defaultdict
@@ -1144,7 +1178,7 @@
index 5ca68d1..b5a12fb 100644
--- a/xpybutil/rect.py
+++ b/xpybutil/rect.py
-@@ -5,7 +5,7 @@ For example, finding the area of intersection of two rectangles with
+@@ -5,7 +5,7 @@
``rect_intersect_area``, or getting the rectangle of a monitor after accounting
for struts with ``monitor_rects``.
"""
@@ -1166,7 +1200,7 @@
index 882ca77..43936a7 100644
--- a/xpybutil/render.py
+++ b/xpybutil/render.py
-@@ -6,7 +6,7 @@ quite nice.) It's called pycompmgr.
+@@ -6,7 +6,7 @@
This is meant to be a very close translation to the corresponding xcb-util
module. Mostly because I lack a deep understanding of everything here.
"""
@@ -1175,7 +1209,7 @@
class PictFormat:
Id = 1
-@@ -34,7 +34,7 @@ standardFormats = [
+@@ -34,7 +34,7 @@ class PictStandard:
{
'template': {
'id': 0,
@@ -1184,7 +1218,7 @@
'depth': 32,
'direct': {
'red': 16,
-@@ -59,7 +59,7 @@ standardFormats = [
+@@ -59,7 +59,7 @@ class PictStandard:
{
'template': {
'id': 0,
@@ -1193,7 +1227,7 @@
'depth': 24,
'direct': {
'red': 16,
-@@ -83,7 +83,7 @@ standardFormats = [
+@@ -83,7 +83,7 @@ class PictStandard:
{
'template': {
'id': 0,
@@ -1202,7 +1236,7 @@
'depth': 8,
'direct': {
'red': 0,
-@@ -107,7 +107,7 @@ standardFormats = [
+@@ -107,7 +107,7 @@ class PictStandard:
{
'template': {
'id': 0,
@@ -1211,7 +1245,7 @@
'depth': 4,
'direct': {
'red': 0,
-@@ -131,7 +131,7 @@ standardFormats = [
+@@ -131,7 +131,7 @@ class PictStandard:
{
'template': {
'id': 0,
@@ -1224,7 +1258,7 @@
index 9cd7589..be3bbea 100644
--- a/xpybutil/util.py
+++ b/xpybutil/util.py
-@@ -5,7 +5,7 @@ heavily used throughout the rest of xpybutil.
+@@ -5,7 +5,7 @@
"""
import struct
@@ -1255,7 +1289,7 @@
index 77c7a20..369974f 100644
--- a/xpybutil/window.py
+++ b/xpybutil/window.py
-@@ -31,7 +31,7 @@ The idea here is to tell X that you want events that fall under
+@@ -31,7 +31,7 @@ def func(e):
the 'PropertyChange' category. Then you bind 'func' to the
particular event 'PropertyNotify'.
"""
@@ -1282,7 +1316,7 @@
index c76a1b1..b8c8806 100644
--- a/xpybutil/xinerama.py
+++ b/xpybutil/xinerama.py
-@@ -8,13 +8,13 @@ monitor indices in a physical ordering (left to right, top to
+@@ -8,13 +8,13 @@
bottom). These indices can then be used in the list returned by
'get_monitors'.
"""
More information about the arch-commits
mailing list