[pygtk] Funny Indent

Nawal <Galileon> Husnoo galileon at gmail.com
Thu Apr 16 01:57:14 WST 2009


Dear PyGTK users,

I have never used PyGTK, and I only wanted to extract some gstreamer webcam
code from a script I found on:

http://giss.tv/wiki/index.php/Streaming_Tools#GStreamer_2


I have removed most of the codes I don't need, but I'm puzzled by the
indentation used:

class GTK_Main:

    def __init__(self):
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.set_title("Webcam Streamer")
        window.set_default_size(1024, 768)

        window.connect("destroy", gtk.main_quit, "WM destroy")
                self.sstate = 'preparing'
<<<<======================================

                red=gtk.gdk.color_parse('grey')
                eb=gtk.EventBox()
                eb.modify_bg(gtk.STATE_NORMAL, red)
                window.add(eb)

        windows = gtk.ScrolledWindow()
        windows.set_size_request(600, 400)
        eb.add(windows)


Could anyone tell me if this has something to do with PyGTK itself or if
it's something deeper in Python? If I remove the "extra" indent, and run the
code, it gives this error:

  File "./Webcamstream-v4l2.pys", line 29
    red=gtk.gdk.color_parse('grey')
    ^
IndentationError: unexpected indent


If I remove the indent in all 5 indented lines, it complains in the same way
with the next one:

  File "./Webcamstream-v4l2.pys", line 34
    windows = gtk.ScrolledWindow()
    ^
IndentationError: unexpected indent

Any ideas?

Thanks,

Nawal.

-- 
The best way to predict the future is to invent it. - Alan Kay
http://www.galileon.co.uk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090415/1b269738/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Webcamstream-v4l2.pys
Type: application/octet-stream
Size: 2291 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20090415/1b269738/attachment.obj 


More information about the pygtk mailing list