Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm having some trouble with Python, again. I created a project using Quickly, and it created a preferences dialog for me. I am now trying to build up the preferences dialog, but I always get some error pointing me at a piece of code Quickly generated itself.

robin@RobinJ:~/Ubuntu One/Python/gtkreddit$ quickly run
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
WARNING:gtkreddit_lib: connect_signals() 'expected handler 'btnRefresh_clicked' in /home/robin/Ubuntu One/Python/gtkreddit/gtkreddit/GtkredditWindow.pyc'
Traceback (most recent call last):
  File "bin/gtkreddit", line 33, in <module>
    gtkreddit.main()
  File "/home/robin/Ubuntu One/Python/gtkreddit/gtkreddit/__init__.py", line 33, in main
    window = GtkredditWindow.GtkredditWindow()
  File "/home/robin/Ubuntu One/Python/gtkreddit/gtkreddit_lib/Window.py", line 35, in __new__
    new_object.finish_initializing(builder)
  File "/home/robin/Ubuntu One/Python/gtkreddit/gtkreddit/GtkredditWindow.py", line 50, in finish_initializing
    dlgPreferences = PreferencesDialog ()
  File "/home/robin/Ubuntu One/Python/gtkreddit/gtkreddit_lib/PreferencesDialog.py", line 26, in __new__
    new_object.finish_initializing(builder)
AttributeError: 'NoneType' object has no attribute 'finish_initializing'

This is the piece it is complaining about;

def finish_initializing(self, builder): # pylint: disable=E1002
    """Set up the preferences dialog"""
    super(PreferencesGtkredditDialog, self).finish_initializing(builder)

The entire code can be found here.

Please assist. I'm pretty new to Python.

share|improve this question
    
Did you rename your preferences dialog in Glade? –  mhall119 Jun 26 '12 at 15:12
    
@mhall119 Erm... I believe I did. What's the default name again? –  RobinJ Jun 26 '12 at 15:21

1 Answer 1

up vote 1 down vote accepted

The base class for the Preferences dialog is looking for an object named preferences_gtkreddit_dialog, you need to either rename the dialog back to that.

In addition, somehow your PreferencesGtkredditDialog Glade file has been changed to think it is an instance of GtkDialog, where it should be an instance of PreferencesGtkredditDialog.

share|improve this answer
    
Not fixed yet. paste.ubuntu.com/1060918 –  RobinJ Jun 26 '12 at 15:26
    
Can you push the latest code your your branch on Lanchpad so I can check it again? –  mhall119 Jun 26 '12 at 18:50
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.