rox.loading | index

`ROX applications should provide good drag-and-drop support. Use this module
to allow drops onto widgets in your application.`

Classes

``

exceptions.Exception
  RemoteFiles
XDSLoader

class RemoteFiles(exceptions.Exception)
`` | `Internal use`

Methods defined here:

__init__(self)

class XDSLoader
`` | `A mix-in class for widgets that can have files/data dropped on them. If object is also a GtkWidget, xds_proxy_for(self) is called automatically.`

Methods defined here:

__init__(self, types)
  `Call this after initialising the widget.
  Types is a list of MIME-types, or None to only accept files.`

xds_data_received(self, widget, context, x, y, selection, info, time)
  `Called when we get some data. Internal.`

xds_drag_drop(self, widget, context, data, info, time)
  `Called when something is dropped on us. Decide which of the
  offered targets to request and ask for it. xds_data_received will
  be called when it finally arrives.`

xds_load_from_file(self, path)
  `Try to load this local file. Override this if you have a better way
  to load files. The default method opens the file and calls xds_load_from_stream().`

xds_load_from_selection(self, selection, leafname=None)
  `Try to load this selection (data from another application). The default
  puts the data in a cStringIO and calls xds_load_from_stream().`

xds_load_from_stream(self, name, mimetype, stream)
  `Called when we get any data sent via drag-and-drop in any way (local
  file or remote application transfer). You should override this and do
  something with the data. 'name' may be None (if the data is unnamed),
  a leafname, or a full path or URI. 'mimetype' is the MIME type, or None if
  unknown.`

xds_load_uris(self, uris)
  `Try to load each URI in the list. Override this if you can handle URIs
  directly. The default method passes each local path to xds_load_from_file()
  and displays an error for anything else.
  The uris are escaped, so a space will appear as '%20'`

xds_proxy_for(self, widget)
  `Handle drops on this widget as if they were to 'self'.`

Functions

``

extract_uris(data)
  `Convert a text/uri-list to a python list of (still escaped) URIs`

provides(context, type)