greetings,
I've stumbled upon a problem, and I'm not sure if it's a problem with
python, or with pygtk. My system is a much upgraded redhat 7.3 machine, so I
don't have gtk2 or gnome2. I'm running python 2.3a2.
When I run 'xdisplay.py' (attached), I get a traceback:
[~/projects/sharedmailbox] [2:51pm] [eros] % ./xdisplay.py
Traceback (most recent call last):
File "./xdisplay.py", line 7, in ?
from twisted.internet import gtkreactor; gtkreactor.install()
File
"/usr/local/lib/python2.3/site-packages/twisted/internet/gtkreactor.py",
line 39, in ?
pygtk.require('1.2')
File "/usr/local/lib/python2.3/site-packages/pygtk.py", line 47, in
require
versions = _get_available_versions()
File "/usr/local/lib/python2.3/site-packages/pygtk.py", line 34, in
_get_available_versions
for filename in os.listdir(dir):
OSError: [Errno 20] Not a directory: '/usr/local/lib/python23.zip'
The error is "Not a directory" instead of "File not found" because I
attempted to create a python23.zip file using the zip tool, but to no avail.
'sys.path' is defined as:
>>> import sys; print sys.path
['', '/usr/local/lib/python23.zip', '/usr/local/lib/python2.3',
'/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk',
'/usr/local/lib/python2.3/lib-dynload',
'/usr/local/lib/python2.3/site-packages',
'/usr/local/lib/python2.3/site-packages/gtk-1.2']
Notice '/usr/local/lib/python23.zip' as the first real entry.
Is this a problem with python, or with pygtk?
Thanks in advance.
Regards,
Jeff MacDonald
--
|| Jeff - http://zoidtechnologies.com/
#!/usr/bin/env python
#
# $Id: xdisplay.py,v 1.2 2003/02/21 18:29:09 jam Exp $
#
from twisted.internet import gtkreactor; gtkreactor.install()
from twisted.internet import reactor
def DestroyFunction(obj):
mainquit()
widgetTree = libglade.GladeXML("xdisplay.glade")
dic = { "on_window1_destroy" : DestroyFunction }
widgetTree.signal_autoconnect (dic)
reactor.run()
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>Project1</name>
<program_name>project1</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
</project>
<widget>
<class>GtkWindow</class>
<name>window1</name>
<title>window1</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_CENTER</position>
<modal>False</modal>
<default_width>300</default_width>
<default_height>300</default_height>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>clist1</name>
<can_focus>True</can_focus>
<columns>3</columns>
<column_widths>62,144,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label2</name>
<label>Claim</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label3</name>
<label>From</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label4</name>
<label>Subject</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label5</name>
<label>Command</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>entry1</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkStatusbar</class>
<name>statusbar1</name>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</GTK-Interface>