1

I am trying to learn to develop apps in ubuntu and currently i am going through this tutorial.

As shown in the video I am writing the below given codes:

self.refreshbutton = self.builder.get_object("refreshbutton")
def on_refreshbutton_clicked(self, widget):
print "Refresh"

As soon as I try to run my application it is giving me an error :

I type this command to run my application : quickly run

(trickybrowser:4418): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1971:11: Not using units is deprecated. Assuming 'px'.

(trickybrowser:4418): Gtk-WARNING **: Failed to parse /usr/share/themes/mac-os-lion-theme-v2/gtk-3.0/settings.ini: Key file contains line '/* ' which is not a key-value pair, group, or comment
Traceback (most recent call last):
  File "bin/trickybrowser", line 32, in <module>
    import trickybrowser
  File "/home/tricky/trickybrowser/trickybrowser/__init__.py", line 14, in <module>
    from trickybrowser import TrickybrowserWindow
  File "/home/tricky/trickybrowser/trickybrowser/TrickybrowserWindow.py", line 32
    print "Refresh"
        ^
IndentationError: expected an indented block

2 Answers 2

4

Remember about indent:

self.refreshbutton = self.builder.get_object("refreshbutton")
def on_refreshbutton_clicked(self, widget):
    print "Refresh"
1
  • Python uses indentation to mark blocks of code rather than using some other language element. You should also consistently use spaces rather than tabs in your program so that code that looks one way to you doesn't look another way to the Python interpreter. Commented Sep 23, 2012 at 20:54
0
(trickybrowser:4418): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1971:11: Not using units is deprecated. Assuming 'px'.

(trickybrowser:4418): Gtk-WARNING **: Failed to parse /usr/share/themes/mac-os-lion-theme-v2/gtk-3.0/settings.ini: Key file contains line '/* ' which is not a key-value pair, group, or comment

These 2 Gtk-WARNINGS are due to some errors in the settings.ini file and gtk-widgets.css of the mac-os-lion theme.

To Correct them,

  • sudo gedit /usr/share/themes/mac-os-lion-theme-v2/gtk-3.0/settings.ini.

    Use # for comments instead of \* .. */
#
#   AUTHOR: mbossg
#   WEBSITE: http://mbossg.deviantart.com
#   LICENSE: GPL
#   DESCRIPTION: A minimalistic and usable theme made for gtk3 apps.
#
  • sudo gedit /usr/share/themes/mac-os-lion-theme-v2/gtk-3.0/gtk-widgets.css.

    Goto line number 1971 and replace padding: 8; with padding: 8px;

  • That's it. No more warnings from Gtk. Have a Happy Time using mac-os-lion-theme !!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .