;ς ‹K@c@s‚dZdkZdklZlZlZlZeiZdZdZd„Z d„Z de fd„ƒYZ d fd „ƒYZ dS( s|ROX applications should provide good drag-and-drop support. Use this module to allow drops onto widgets in your application.N(sgsalertsget_local_paths_iicCsq|idƒ}g}xQ|D]I}|tdƒjoqn|o|ddjo|i|ƒqqW|SdS(s@Convert a text/uri-list to a python list of (still escaped) URIss is#N(sdatassplitslinessoutslschrsappend(sdataslinesslsout((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys extract_uris scCs|tt|iƒjSdS(N(stypesmapsstrscontextstargets(scontextstype((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pysprovidesss RemoteFilescBstZdZd„ZRS(s Internal usecCsti|tdƒƒdS(NsiCannot load files from a remote machine (multiple files, or target application/octet-stream not provided)(s Exceptions__init__sselfs_(sself((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys__init__s(s__name__s __module__s__doc__s__init__(((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys RemoteFiless s XDSLoadercBsYtZdZd„Zd„Zd„Zd„Zd„Zd„Ze d„Z d„Z RS( s’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.cCs|ddtfg}|o2x/|dgD]}|i|dtfƒq'Wn||_t|ti ƒo|i |ƒndS(sgCall this after initialising the widget. Types is a list of MIME-types, or None to only accept files.s text/uri-listisapplication/octet-streamN( sTARGET_URILISTstargetsstypessmimetypesappends TARGET_RAWsselfs isinstancesgsWidgets xds_proxy_for(sselfstypessmimetypestargets((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys__init__$s cCs[|ititiB|ititi Bti Bƒ|i d|i ƒ|i d|i ƒdS(s6Handle drops on this widget as if they were to 'self'.sdrag-data-receiveds drag-dropN(swidgets drag_dest_setsgsDEST_DEFAULT_MOTIONsDEST_DEFAULT_HIGHLIGHTsselfstargetssgdks ACTION_COPYs ACTION_MOVEsACTION_PRIVATEsconnectsxds_data_receiveds xds_drag_drop(sselfswidget((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys xds_proxy_for1s cCsŒ|i||iƒ}t|_|tjo|it |ƒnFt |dƒo"dk }|i |t ƒ|_n|i|||ƒtSdS(s€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.sXdndDirectSave0N(swidgetsdrag_dest_find_targetscontextsselfstargetsstargetsNones rox_leafnames drop_finishsFalsestimesprovidesssavings_read_xds_propertys drag_get_datasTrue(sselfswidgetscontextsdatasinfostimestargetssaving((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys xds_drag_drop;s   c Csx|itjo|it|ƒdSn|tjoLy|i ||i ƒWn|it|ƒ‚nX|it |ƒdSn|t jodSnt|iƒ}| o"tdƒ|it|ƒdSnymy|i|ƒWnUtj oIt|ƒdjpt|dƒ o‚n|i|d|ƒdSnXWn!|it|ƒtiƒnX|it |ƒdSdS(s'Called when we get some data. Internal.NiisNothing to load!sapplication/octet-stream(s selectionsdatasNonescontexts drop_finishsFalsestimesinfos TARGET_RAWsselfsxds_load_from_selections rox_leafnamesTruesTARGET_URILISTs extract_urissurissalerts xds_load_uriss RemoteFilesslensprovidesswidgets drag_get_datasroxsreport_exception( sselfswidgetscontextsxsys selectionsinfostimesuris((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pysxds_data_receivedKs@   $ cCs€g}x2|D]*}t|ƒ}|o|i|ƒq q Wt|ƒt|ƒjo t‚nx|D]}|i |ƒqeWdS(sχ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'N( spathssurissurisget_local_pathspathsappendslens RemoteFilessselfsxds_load_from_file(sselfsurisspathssurispath((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys xds_load_urisss  cCs8y |i|tt|dƒƒWntiƒnXdS(s˜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().srbN(sselfsxds_load_from_streamspathsNonesopensroxsreport_exception(sselfspath((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pysxds_load_from_file‚s  cCsa|itjotiiƒdSndkl}t|i ƒ}|i ||||iƒƒdS(sˆTry to load this selection (data from another application). The default puts the data in a cStringIO and calls xds_load_from_stream().N(sStringIO(s selectionsdatasNonesgsgdksbeeps cStringIOsStringIOsstrstypesmimetypesselfsxds_load_from_streamsleafname(sselfs selectionsleafnamesmimetypesStringIO((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pysxds_load_from_selectionŠs  cCstd||fƒdS(s,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.sHGot some data, but missing code to handle it! (name="%s";mimetype="%s")N(salertsnamesmimetype(sselfsnamesmimetypesstream((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pysxds_load_from_stream”s( s__name__s __module__s__doc__s__init__s xds_proxy_fors xds_drag_dropsxds_data_receiveds xds_load_urissxds_load_from_filesNonesxds_load_from_selectionsxds_load_from_stream(((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys XDSLoaders   (   (s__doc__sroxsgsalertsget_local_paths_sgdksTARGET_URILISTs TARGET_RAWs extract_urissprovidess Exceptions RemoteFiless XDSLoader( s XDSLoadersgsget_local_paths TARGET_RAWsalertsroxs extract_urissprovidess RemoteFilessTARGET_URILISTsgdks_((sU/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/loading.pys?s