Hi,

I am trying to subclass gio.File, but I'm having trouble... it seems
like Python (or gio) just won't let me. This snippet will explain it
fully:

import gio
class SubGio(gio.File):
    def __init__(self, path):
        super(gio.File, self).__init__(path)
    @property
    def name(self):
        return self.get_basename()

>>> sub = SubGio('foofile.txt')
>>> type(sub)
<class '__main__.__main__.GLocalFile'>
>>> sub.name
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: '__main__.GLocalFile' object has no attribute 'name'


For reference, I'm using Python 2.6.4 and pygobject 2.21.1

Anyone know what's going on here??


Thanks!
Jens Knutson
-- 
"We act as though comfort and luxury were the chief requirements in
life, when all we need to make us really happy is something to be
enthusiastic about."
- Charles Kingsley
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to