Hi everybody.
I'm completely new to python-xlib and to xlib and to X programming, so
the subject could be because my ignorance.
Since my python-xlib-0.12-r1 on gentoo didn't worked (examples
crashed out of the box) i downloaded this morning the cvs version.
Then i first tried the examples since i'm just approaching
python-xlib. The examples work smooth, so i tried to touch one of them
and start messing around. I get an error, so after some time trying to
figure out what was happening i tried the example but from another
directory, and voilá! there was the same error.
I can't even figure out why the path has influence in this issue, but
the thing was that the example 'draw.py' tun from another directory
gives this error:
$ ./draw.py
Traceback (most recent call last):
File "./draw.py", line 231, in ?
Window(display.Display()).loop()
File "/usr/lib/python2.4/site-packages/Xlib/display.py", line 80, in
__init__
self.display = _BaseDisplay(display)
File "/usr/lib/python2.4/site-packages/Xlib/display.py", line 67, in
__init__
apply(protocol.display.Display.__init__, (self, ) + args, keys)
File "/usr/lib/python2.4/site-packages/Xlib/protocol/display.py",
line 53, in __init__
name, host, displayno)
TypeError: get_auth() takes exactly 3 arguments (4 given)
So i went to check 'display.py' and later 'connect.py' which has the
definition of the function 'get_auth()' and it looks like this:
def get_auth(dname, host, dno):
...
But it's called from 'display.py' on line 52 like this:
auth_name, auth_data = connect.get_auth(self.socket,
name, host, displayno)
Clearly there's something wrong in there. I eliminated 'self.socket'
variable and tried to run the example 'draw.py' and this time it
worked ok.
So 3 things:
- why is self.socket used there? what was the intention?
- why 'draw.py' works calling it from the cvs repository directory?
- it's ok what i have done eliminating self.socket or functions has to
be redefined and what is wrong is 'connect.py' def and not
'display.py' call?
I like very much the idea of python-xlib bindings, it was the only
library i found that accomodates my necessities, but it seems to be
pretty abandoned. The README says it's usable in production, is it
true? Can i make a window manager with it? (yes i know, there are
zillions wm why another one, well it happens i think i got a unique
idea ;) or maybe i just want to have some fun ;)
Anyway i will like to help with python-xlib. I hope this is a start.
I'll be using the library without the self.socket variable, please
someone tell me if that's ok.
--
Fernando Canizo - http://www.lugmen.org.ar/~conan/
Más adentro que Los Chalchaleros
|