[pygtk] Problem in referencing Glade widegets

ganesh gajre gnowledge.ganesh at gmail.com
Mon Jun 29 14:45:22 WST 2009


Hi all,

 I am writing a program in which i want to get the image file which is
created on the server  to my desktop. For whicj i am looking for the same
url which i used to connect to my server database.

I had written a small function to get the url address. Code is as follow:

Glade file Reference is:

self.xml = gtk.glade.XML('gnome-gnowser.glade')
self.app= self.app = self.xml.get_widget('app1')


My Function is:

def load_image(self,
ssid):



"""

        This method is used to load the image from the server to client
side


"""


        print "xml ref : %s" %
str(self.xml)


        print "APPLICATIO : %s" % str(self.xml.get_widget('app1')
)


        print "ADDRESSBOX : %s" %
str(self.xml.get_widget('address_entry'))


        url_address =
self.xml.get_widget('address_entry').child.get_text()


        print "Inside
load_image",self.host_port_db


        os.system('wget -c '+url_address+'/Data/nbhimages/'+'43.xdot
-O'+self.gnowser_path)


        return "done"


When i add something to database i call the load_image( ) method for loading
generated image on my desktop
O/P : """"after calling Load_image() """


xml ref : <glade.XML object at 0xae2db44 (PyGladeXML at 0xb17a498)> //
First  line of load_image method for printing xml referece is perfet.....
APPLICATIO : None
ADDRESSBOX : None

Traceback (most recent call last):
  File "gnowser.py", line 1491, in add_to_gnowsys
    self.load_image(ssid)
  File "gnowser.py", line 2512, in load_image
    url_address =
self.xml.get_widget('address_entry').child.get_text()

AttributeError: 'NoneType' object has no attribute 'child'


Can anyone please help me to solve this?

Regards,
Ganesh Gajare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090629/94d98cdf/attachment.htm 


More information about the pygtk mailing list