Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in file -> /usr/lib/rhythmbox/plugins/rb/Loader.py
- def get_url_chunks (self, uri, chunksize, want_size, callback, *args):
- # this can't possibly work yet, we need to get annotations and
- # other stuff for g_input_stream_read_async right first.
- raise Exception("rb.ChunkLoader not implemented yet")
- try:
- self.uri = uri
- self.chunksize = chunksize
- self.total = 0
- self.callback = callback
- self.args = args
- file = Gio.File(uri)
- if want_size:
- file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_SIZE, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_DEFAULT, self._cancel, self._info_cb, None)
- else:
- file.read_async(GLib.PRIORITY_DEFAULT, self._cancel, self._open_cb, None)
- except Exception, e:
- print "error reading file %s: %s" % (uri, e.message)
- self._callback(e)
Advertisement
Add Comment
Please, Sign In to add comment