Skip to content

Commit f987056

Browse files
committed
Preparing 0.11 release
1 parent 7399f1c commit f987056

10 files changed

Lines changed: 63 additions & 38 deletions

File tree

‎MANIFEST.in‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ include utils/tcpbug.py utils/parsexbug.py
1515
include examples/draw.py examples/draw-proto.py examples/profilex.py
1616
include examples/threadtest.py
1717

18-
include tests/test*.py

‎NEWS‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
NEWS for Python X Library
44

5+
* Version 0.11 23 Feb 2001
6+
7+
** Regression tests for the protocol definition
8+
9+
Regressions tests have been created for all requests, replies and
10+
events. The tests use PyUnit, and the old resource database test has
11+
been updated to use it too.
12+
13+
** A lot of protocol bugfixes
14+
15+
The bugs discovered by the regression tests have been fixed.
16+
Additionally, a subtle bug in the core engine which could cause a
17+
"can't happen"-error has also been found and fixed.
18+
19+
520
* Version 0.10 16 Dec 2001
621

722
** Event bugfix

‎README‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
The Python X Library
33

4-
Version 0.10, 16 Dec 2001
4+
Version 0.11, 23 Dec 2001
55

66

77
*** Copyright
88

9-
Copyright (C) 2000,2001 Peter Liljenberg
9+
Copyright (C) 2000-2002 Peter Liljenberg
1010

1111
The Python X Library is released under GPL, see the file COPYING for
1212
details.
@@ -78,8 +78,9 @@ There is a resource database implementation, ICCCM support and a
7878
framework for adding X extension code. Currently only the XTEST
7979
extension has been implemented.
8080

81-
There are most likely still bugs, although a large part of the library
82-
has been exercised now and seems to work just fine.
81+
There are most likely still bugs, but the library is at least stable
82+
enough to run PLWM. A continously bigger part of the library is
83+
covered by regression tests, improving stability.
8384

8485
The documentation is still quite rudimentary, but should be of some
8586
help for people programming with the Xlib. X beginners should first

‎TODO‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,24 @@
1818
*** Miscellaneous
1919

2020
* Faster, faster! The protocol engine isn't very fast, despite the
21-
optimizations in version 0.7.
21+
optimizations in version 0.7. I've started on this, but it is a big
22+
job.
2223

2324
* The tread support and the protocol engine needs to be stress
2425
tested. They _seem_ to work, but that's no guarantee.
2526

2627
* Much more documentation.
2728

2829
* Test suite: a test suite which exercises the entire library would
29-
definitely be a nice thing to have.
30+
definitely be a nice thing to have. A start has been made for this,
31+
testing the protocol definitions.
3032

3133
* Porting: the library should be runnable wherever there is a Python
3234
interpreter (with the necessary IPC support, that is.)
3335

3436
* Widget set: a Python-optimized widget set using the X library would
35-
be really cute.
37+
be really cute. The AnyGUI project could be a good front-end to
38+
use.
3639

3740
* Server-side support: while we're at it, why not extend the library
3841
to provide at least the server-side parsing of the X protocol? It

‎Xlib/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: __init__.py,v 1.11 2001-12-16 14:23:38 petli Exp $
1+
# $Id: __init__.py,v 1.12 2002-02-25 11:09:23 petli Exp $
22
#
33
# Xlib.__init__ -- glue for Xlib package
44
#
@@ -20,7 +20,7 @@
2020

2121
import string
2222

23-
__version__ = (0, 10)
23+
__version__ = (0, 11)
2424

2525
__version_string__ = string.join(map(str, __version__), '.')
2626

‎Xlib/protocol/ChangeLog‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2002-02-22 Peter Liljenberg <peter.liljenberg@esdgkonsult.com>
2+
3+
* event.py(CirculateNotify, CirculateRequest): These are
4+
identical, so subclass the common Circulate.
5+
6+
2002-02-13 Peter Liljenberg <peter.liljenberg@esdgkonsult.com>
7+
8+
* rq.py (ValueList.parse_binary_value): Use = both for calcsize
9+
and unpacking. Caused problems on Alpha.
10+
111
2002-02-11 Peter Liljenberg <peter.liljenberg@esdgkonsult.com>
212

313
* request.py (GetWindowAttributes): Rename class to win_class.

‎Xlib/protocol/display.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# $Id: display.py,v 1.16 2002-01-14 16:50:22 petli Exp $
1+
# $Id: display.py,v 1.17 2002-02-25 11:09:23 petli Exp $
22
#
33
# Xlib.protocol.display -- core display communication
44
#
5-
# Copyright (C) 2000,2001 Peter Liljenberg <petli@ctrl-c.liu.se>
5+
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
66
#
77
# This program is free software; you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by

‎Xlib/protocol/event.py‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# $Id: event.py,v 1.5 2001-12-16 14:23:38 petli Exp $
1+
# $Id: event.py,v 1.6 2002-02-25 11:09:23 petli Exp $
22
#
33
# Xlib.protocol.event -- definitions of core events
44
#
5-
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
5+
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
66
#
77
# This program is free software; you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by
@@ -288,8 +288,8 @@ class ResizeRequest(rq.Event):
288288
rq.Pad(20),
289289
)
290290

291-
class CirculateNotify(rq.Event):
292-
_code = X.CirculateNotify
291+
class Circulate(rq.Event):
292+
_code = None
293293
_fields = rq.Struct( rq.Card8('type'),
294294
rq.Pad(1),
295295
rq.Card16('sequence_number'),
@@ -300,17 +300,11 @@ class CirculateNotify(rq.Event):
300300
rq.Pad(15),
301301
)
302302

303-
class CirculateRequest(rq.Event):
303+
class CirculateNotify(Circulate):
304+
_code = X.CirculateNotify
305+
306+
class CirculateRequest(Circulate):
304307
_code = X.CirculateRequest
305-
_fields = rq.Struct( rq.Card8('type'),
306-
rq.Pad(1),
307-
rq.Card16('sequence_number'),
308-
rq.Window('parent'),
309-
rq.Window('window'),
310-
rq.Pad(4),
311-
rq.Card8('place'),
312-
rq.Pad(15),
313-
)
314308

315309
class PropertyNotify(rq.Event):
316310
_code = X.PropertyNotify
@@ -398,7 +392,7 @@ class ClientMessage(rq.Event):
398392
class KeymapNotify(rq.Event):
399393
_code = X.KeymapNotify
400394
_fields = rq.Struct( rq.Card8('type'),
401-
rq.FixedList('data', 31, rq.Card8Obj)
395+
rq.FixedList('data', 31, rq.Card8Obj, pad = 0)
402396
)
403397

404398

‎Xlib/protocol/request.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# $Id: request.py,v 1.9 2002-02-12 10:11:11 petli Exp $
1+
# $Id: request.py,v 1.10 2002-02-25 11:09:23 petli Exp $
22
#
33
# Xlib.protocol.request -- definitions of core requests
44
#
5-
# Copyright (C) 2000-2001 Peter Liljenberg <petli@ctrl-c.liu.se>
5+
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
66
#
77
# This program is free software; you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by

‎Xlib/protocol/rq.py‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# $Id: rq.py,v 1.13 2002-02-12 10:11:11 petli Exp $
1+
# $Id: rq.py,v 1.14 2002-02-25 11:09:23 petli Exp $
22
#
33
# Xlib.protocol.rq -- structure primitives for request, events and errors
44
#
5-
# Copyright (C) 2000,2001 Peter Liljenberg <petli@ctrl-c.liu.se>
5+
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
66
#
77
# This program is free software; you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by
@@ -446,9 +446,10 @@ class List(ValueField):
446446

447447
structcode = None
448448

449-
def __init__(self, name, type):
449+
def __init__(self, name, type, pad = 1):
450450
ValueField.__init__(self, name)
451451
self.type = type
452+
self.pad = pad
452453

453454
def parse_binary_value(self, data, display, length, format):
454455
if length is None:
@@ -501,7 +502,8 @@ def parse_binary_value(self, data, display, length, format):
501502

502503
data = buffer(data, pos)
503504

504-
data = buffer(data, len(data) % 4)
505+
if self.pad:
506+
data = buffer(data, len(data) % 4)
505507

506508
return ret, data
507509

@@ -517,15 +519,16 @@ def pack_value(self, val):
517519

518520
data = string.join(data, '')
519521

520-
dlen = len(data)
521-
data = data + '\0' * ((4 - dlen % 4) % 4)
522+
if self.pad:
523+
dlen = len(data)
524+
data = data + '\0' * ((4 - dlen % 4) % 4)
522525

523526
return data, len(val), None
524527

525528

526529
class FixedList(List):
527-
def __init__(self, name, size, type):
528-
List.__init__(self, name, type)
530+
def __init__(self, name, size, type, pad = 1):
531+
List.__init__(self, name, type, pad)
529532
self.size = size
530533

531534
def parse_binary_value(self, data, display, length, format):
@@ -721,7 +724,7 @@ def parse_binary_value(self, data, display, length, format):
721724
if mask & flag:
722725
if field.structcode:
723726
vals = struct.unpack('=' + field.structcode,
724-
data[:struct.calcsize(field.structcode)])
727+
data[:struct.calcsize('=' + field.structcode)])
725728
if field.structvalues == 1:
726729
vals = vals[0]
727730

0 commit comments

Comments
 (0)