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 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
share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted
(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 !!!

share|improve this answer
add comment

Remember about indent:

self.refreshbutton = self.builder.get_object("refreshbutton")
def on_refreshbutton_clicked(self, widget):
    print "Refresh"
share|improve this answer
    
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. –  John S Gruber Sep 23 '12 at 20:54
add comment

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.