Logo Search packages:      
Sourcecode: webboard version File versions  Download package

def webboardlib::webboard::WebBoard::open_file (   self,
  path 
)
Read the content of the specified file and write it to
the text view

Definition at line 198 of file webboard.py.

                             :
        """
        Read the content of the specified file and write it to
        the text view
        """
        def read_async_cb(input_stream, result):
            data = input_stream.read_finish(result)
            self.textview.get_buffer().set_text(str(data))
            input_stream.close()
            self.window_main.window.set_cursor(None)
            
        try:
            self.window_main.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
            fp = gio.File(path)
            input_stream = fp.read()
            #64k ought to be enough for anyone ...
            input_stream.read_async(1024 ** 2, read_async_cb)
        except Exception, err:
            self.window_main.window.set_cursor(None)
            raise


Generated by  Doxygen 1.6.0   Back to index