Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit f19e93b

Browse files
committed
Whitespace fixes, also a (probable?) build fix.
1 parent ed289a8 commit f19e93b

File tree

6 files changed

+50
-45
lines changed

6 files changed

+50
-45
lines changed

debian/changelog

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
python-xpybng (1.3-oneiric5) oneiric; urgency=low
1+
xpyb-ng (1.3-precise2) precise; urgency=low
2+
3+
* (Potentially?) fix a build error
4+
5+
-- Tycho Andersen <tycho@tycho.ws> Sat, 27 Feb 2012 17:40:09 -0600
6+
7+
xpyb-ng (1.3-precise1) precise; urgency=low
28

39
* Initial release
410

debian/control

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
Source: python-xpybng
1+
Source: xpyb-ng
22
Section: universe/python
33
Priority: optional
44
Maintainer: Tycho Andersen <tycho@tycho.ws>
55
Build-Depends: debhelper (>= 8.0.0), libxcb1-dev, python-dev, python-xcbgen, xcb-proto
66
Standards-Version: 3.9.2
77
Homepage: <https://github.com/tych0/xpyb-ng>
88
Vcs-Git: git@github.com:tych0/xpyb-ng.git
9-
#Vcs-Browser: http://git.debian.org/?p=collab-maint/xpybng.git;a=summary
109

1110
Package: python-xpybng
1211
Architecture: any

tools/py_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _py_get_length_field(expr):
255255
'''
256256
if expr.lenfield_name != None:
257257
# This would be nicer if Request had an is_request attribute...
258-
if hasattr(expr.parent.parent, "opcode"):
258+
if hasattr(expr.parent, "parent") and hasattr(expr.parent.parent, "opcode"):
259259
return expr.lenfield_name
260260
else:
261261
return 'self.%s' % expr.lenfield_name

xcb/cookie.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static void
2323
xpybCookie_dealloc(xpybCookie *self)
2424
{
2525
if (self->conn->conn)
26-
xcb_discard_reply(self->conn->conn, self->cookie.sequence);
26+
xcb_discard_reply(self->conn->conn, self->cookie.sequence);
2727

2828
Py_CLEAR(self->reply_type);
2929
Py_CLEAR(self->request);
@@ -50,15 +50,15 @@ xpybCookie_check(xpybCookie *self, PyObject *args)
5050
xpybRequest_get_attributes(self->request, &is_void, NULL, &is_checked);
5151

5252
if (!(is_void && is_checked)) {
53-
PyErr_SetString(xpybExcept_base, "Request is not void and checked.");
54-
return NULL;
53+
PyErr_SetString(xpybExcept_base, "Request is not void and checked.");
54+
return NULL;
5555
}
5656
if (xpybConn_invalid(self->conn))
57-
return NULL;
57+
return NULL;
5858

5959
error = xcb_request_check(self->conn->conn, self->cookie);
6060
if (xpybError_set(self->conn, error))
61-
return NULL;
61+
return NULL;
6262

6363
Py_RETURN_NONE;
6464
}
@@ -75,25 +75,25 @@ xpybCookie_reply(xpybCookie *self, PyObject *args)
7575

7676
/* Check arguments and connection. */
7777
if (is_void) {
78-
PyErr_SetString(xpybExcept_base, "Request has no reply.");
79-
return NULL;
78+
PyErr_SetString(xpybExcept_base, "Request has no reply.");
79+
return NULL;
8080
}
8181
if (xpybConn_invalid(self->conn))
82-
return NULL;
82+
return NULL;
8383

8484
/* Make XCB call */
8585
data = xcb_wait_for_reply(self->conn->conn, self->cookie.sequence, &error);
8686
if (xpybError_set(self->conn, error))
87-
return NULL;
87+
return NULL;
8888
if (data == NULL) {
89-
PyErr_SetString(PyExc_IOError, "I/O error on X server connection.");
90-
return NULL;
89+
PyErr_SetString(PyExc_IOError, "I/O error on X server connection.");
90+
return NULL;
9191
}
9292

9393
/* Create a shim protocol object */
9494
shim = PyBuffer_FromMemory(data, 32 + data->length * 4);
9595
if (shim == NULL)
96-
goto err1;
96+
goto err1;
9797

9898
/* Call the reply type object to get a new xcb.Reply instance */
9999
reply = PyObject_CallFunctionObjArgs((PyObject *)self->reply_type, shim, NULL);
@@ -144,7 +144,7 @@ int xpybCookie_modinit(PyObject *m)
144144
return -1;
145145
Py_INCREF(&xpybCookie_type);
146146
if (PyModule_AddObject(m, "Cookie", (PyObject *)&xpybCookie_type) < 0)
147-
return -1;
147+
return -1;
148148

149149
return 0;
150150
}

xcb/ext.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ xpybExt_init(xpybExt *self, PyObject *args)
2828
xpybExtkey *key = (xpybExtkey *)Py_None;
2929

3030
if (!PyArg_ParseTuple(args, "O!|O!", &xpybConn_type, &conn, &xpybExtkey_type, &key))
31-
return -1;
31+
return -1;
3232

3333
Py_INCREF(self->key = key);
3434
Py_INCREF(self->conn = conn);
@@ -105,15 +105,15 @@ xpybExt_send_request(xpybExt *self, PyObject *args, PyObject *kw)
105105
xpybRequest_type, &request,
106106
&xpybCookie_type, &cookie,
107107
&PyType_Type, &reply))
108-
return NULL;
108+
return NULL;
109109

110110
xpybRequest_get_attributes(request, &is_void, &opcode, &is_checked);
111111

112112
if (!is_void)
113-
if (reply == NULL || !PyType_IsSubtype(reply, xpybReply_type)) {
114-
PyErr_SetString(xpybExcept_base, "Reply type missing or not derived from xcb.Reply.");
115-
return NULL;
116-
}
113+
if (reply == NULL || !PyType_IsSubtype(reply, xpybReply_type)) {
114+
PyErr_SetString(xpybExcept_base, "Reply type missing or not derived from xcb.Reply.");
115+
return NULL;
116+
}
117117

118118
/* Set up request structure */
119119
xcb_req.count = 2;
@@ -123,7 +123,7 @@ xpybExt_send_request(xpybExt *self, PyObject *args, PyObject *kw)
123123

124124
/* Allocate and fill in data strings */
125125
if (PyObject_AsReadBuffer(((xpybProtobj *)request)->buf, &data, &size) < 0)
126-
return NULL;
126+
return NULL;
127127
xcb_parts[2].iov_base = (void *)data;
128128
xcb_parts[2].iov_len = size;
129129
xcb_parts[3].iov_base = 0;
@@ -180,7 +180,7 @@ int xpybExt_modinit(PyObject *m)
180180
return -1;
181181
Py_INCREF(&xpybExt_type);
182182
if (PyModule_AddObject(m, "Extension", (PyObject *)&xpybExt_type) < 0)
183-
return -1;
183+
return -1;
184184

185185
return 0;
186186
}

xcb/protobj.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ xpybError_set(xpybConn *conn, xcb_generic_error_t *e)
4141
except = xpybExcept_proto;
4242

4343
if (e) {
44-
opcode = e->error_code;
45-
if (opcode < conn->errors_len && conn->errors[opcode] != NULL) {
46-
type = PyTuple_GET_ITEM(conn->errors[opcode], 0);
47-
except = PyTuple_GET_ITEM(conn->errors[opcode], 1);
48-
}
49-
50-
shim = PyBuffer_FromMemory(e, sizeof(*e));
51-
if (shim == NULL)
52-
return 1;
53-
54-
error = PyObject_CallFunctionObjArgs(type, shim, NULL);
55-
if (error != NULL)
56-
PyErr_SetObject(except, error);
57-
Py_DECREF(shim);
58-
return 1;
44+
opcode = e->error_code;
45+
if (opcode < conn->errors_len && conn->errors[opcode] != NULL) {
46+
type = PyTuple_GET_ITEM(conn->errors[opcode], 0);
47+
except = PyTuple_GET_ITEM(conn->errors[opcode], 1);
48+
}
49+
50+
shim = PyBuffer_FromMemory(e, sizeof(*e));
51+
if (shim == NULL)
52+
return 1;
53+
54+
error = PyObject_CallFunctionObjArgs(type, shim, NULL);
55+
if (error != NULL)
56+
PyErr_SetObject(except, error);
57+
Py_DECREF(shim);
58+
return 1;
5959
}
6060
return 0;
6161
}
@@ -67,11 +67,11 @@ xpybEvent_create(xpybConn *conn, xcb_generic_event_t *e)
6767
PyObject *shim, *event, *type = (PyObject *)xpybEvent_type;
6868

6969
if (opcode < conn->events_len && conn->events[opcode] != NULL)
70-
type = conn->events[opcode];
70+
type = conn->events[opcode];
7171

7272
shim = PyBuffer_FromMemory(e, sizeof(*e));
7373
if (shim == NULL)
74-
return NULL;
74+
return NULL;
7575

7676
event = PyObject_CallFunctionObjArgs(type, shim, NULL);
7777
Py_DECREF(shim);
@@ -97,12 +97,12 @@ xpybProtobj_init(xpybProtobj *self, PyObject *args, PyObject *kw)
9797
PyObject *parent;
9898

9999
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|nn", kwlist,
100-
&parent, &offset, &size))
101-
return -1;
100+
&parent, &offset, &size))
101+
return -1;
102102

103103
self->buf = PyBuffer_FromObject(parent, offset, size);
104104
if (self->buf == NULL)
105-
return -1;
105+
return -1;
106106

107107
return 0;
108108
}

0 commit comments

Comments
 (0)