;ò ëÑ“Fc@s8dZdkZdkZdkZdklZlZlZlZlZdkl Z l Z l Z ei Z dZ dZd„Zd„Zd„Zd dd „Zd „Zd eifd „ƒYZdfd„ƒYZdeifd„ƒYZdeifd„ƒYZdeefd„ƒYZdefd„ƒYZdS(s:All ROX applications that can save documents should use drag-and-drop saving. The document itself should use the Saveable mix-in class and override some of the methods to actually do the save. If you want to save a selection then you can create a new object specially for the purpose and pass that to the SaveBox.N(salertsgs_sfilersescape(schoicessget_local_pathsbasediriicCsZyti||ƒWn?tj o3}|idjo‚ntidI|IJnXdS(sXLike os.chmod, except that permission denied errors are not fatal (for FAT partitions).is#Warning: Failed to set permissions:N( sosschmodspathsmodesOSErrorsexserrnossyssstderr(spathsmodesex((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_chmodscCsA|i}|o |idddti|ƒn|idƒdS(NsXdndDirectSave0s text/plaini(scontexts source_windowswinsvaluesproperty_changesgdksPROP_MODE_REPLACEsproperty_delete(scontextsvalueswin((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_write_xds_propertys   cCs9|i}|idd|ƒ}|o |dSntSdS(s*Returns a UTF-8 encoded, non-escaped, URI.sXdndDirectSave0s text/plainiN(scontexts source_windowswins property_getsdeletesretvalsNone(scontextsdeleteswinsretval((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_read_xds_property&s   i0c Cspdkl}|iddƒ\}}tidd|d|dƒ}| o"t i d|d|dƒ}nt }| odd||f}yA|i|||ƒ}| o d |}|i||ƒ}nWqâd GHqâXn| otidd|dƒ}n| ot i d|dƒ}n|o8ttd ƒoti|||ƒSqlti|ƒSnt Sd S( s@Search for a suitable icon. Returns a pixbuf, or None.(s users_themes/isrox.sourceforge.nets MIME-iconss_s.pngs mime-%s:%ssmime-%ssError loading MIME iconspixbuf_new_from_file_at_sizeN(s icon_themes users_themestypessplitsmediassubtypesbasedirsload_first_configspathschoicessloadsNonesicons icon_names lookup_iconssizesflagsshasattrsgdkspixbuf_new_from_file_at_sizespixbuf_new_from_file( stypessizesflagss users_themesmediassubtypes icon_namespathsicon((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysimage_for_type.s8      cCs<tiƒd}t|tƒo|iƒn tiƒdS(s;Report a AbortSave nicely, otherwise use report_exception()iN(ssyssexc_infosvalues isinstances AbortSavesshowsroxsreport_exception(svalue((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_report_save_errorSs s AbortSavecBs tZdZd„Zd„ZRS(sÑRaise this to cancel a save. If a message is given, it is displayed in a normal alert box (not in the report_exception style). If the message is None, no message is shown (you should have already shown it!)cCs ||_tii||ƒdS(N(smessagesselfsroxs UserAborts__init__(sselfsmessage((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys__init__`s cCs"|ioti|iƒndS(N(sselfsmessagesroxsalert(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysshowds (s__name__s __module__s__doc__s__init__sshow(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys AbortSave[s  sSaveablecBstZdZeZd„Zd„Zd„Zd„ZeZ d„Z d„Z d„Z de_ de_ de_ d „Zd „Zd „ZRS( sThis class describes the interface that an object must provide to work with the SaveBox/SaveArea widgets. Inherit from it if you want to save. All methods can be overridden, but normally only save_to_stream() needs to be. You can also set save_last_stat to the result of os.stat(filename) when loading a file to make ROX-Lib restore permissions and warn about other programs editing the file.cCsdS(sLWhen the data is safely saved somewhere this is called with its new name. Mark your data as unmodified and update the filename for next time. Saving to another application won't call this method. Default method does nothing. The URI may be in the form of a URI or a local path. It is UTF-8, not escaped (% really means %).N((sselfsuri((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_urirscCstdƒ‚dS(sŠWrite the data to save to the stream. When saving to a local file, stream will be the actual file, otherwise it is a cStringIO object.sCYou forgot to write the save_to_stream() method...silly programmer!N(s Exception(sselfsstream((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_to_stream{scCs²tii|ƒ}tii|ƒ oDdkl}y|i|ƒWqjtj ot t ƒ‚qjXndk }d|i dƒ }tii||ƒ}d„}y||ƒ}Wnt }||ƒ}nXy>z|i|ƒWd|iƒX|oti||ƒnWn‚tƒ|otii|ƒoNtii|ƒdjptitdƒ|tiƒoti|ƒq„nt t ƒ‚nX|i|ƒti|ƒdS(sóWrite data to file. Raise an exception on error. The default creates a temporary file, uses save_to_stream() to write to it, then renames it over the original. If the temporary file can't be created, it writes directly over the original.(s fileutilsNstmp-i@BcCs-titi|titiBdƒdƒSdS(Ni€swb(sossfdopensopenspathsO_CREATsO_WRONLY(spath((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys open_private•sisDelete temporary file '%s'?( sosspathsdirnames parent_dirsisdirsroxs fileutilssmakedirssOSErrors AbortSavesNonesrandoms randrangestmpsjoins open_privatesstreamsselfssave_to_streamsclosesrenames_report_save_errorsexistssgetsizesconfirms_sgs STOCK_DELETEsunlinkssave_set_permissionssfilersexamine(sselfspathstmpsstreams open_privatesrandoms fileutilss parent_dir((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys save_to_file‚sB    ,  cCsCdkl}|ƒ}|i|ƒ|i|id|iƒƒdS(sFWrite data to the selection. The default method uses save_to_stream().(sStringIOiN( s cStringIOsStringIOsstreamsselfssave_to_streamsselection_datassetstargetsgetvalue(sselfsselection_datasStringIOsstream((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_to_selection°s    cCsy|itj o|ii}n |i}|tj ot||ƒn/tidƒ}ti|ƒt|d|@ƒdS(sDThe default save_to_file() creates files with the mode 0600 (user read/write only). After saving has finished, it calls this method to set the final permissions. The save_set_permissions(): - sets it to 0666 masked with the umask (if save_mode is None), or - sets it to save_last_stat.st_mode (not masked) otherwise.i?i¶N( sselfssave_last_statsNonesst_modes save_modes_chmodspathsossumasksmask(sselfspaths save_modesmask((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_set_permissions¸s   cCsdS(s7Time to close the savebox. Default method does nothing.N((sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys save_doneÊscCstdƒ‚dS(sÈDiscard button clicked, or document safely saved. Only called if a SaveBox was created with discard=1. The user doesn't want the document any more, even if it's modified and unsaved. Delete it.s?Sorry... my programmer forgot to tell me how to handle Discard!N(s Exception(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysdiscardÎsicCs@t|idƒ odSnt|idƒ odSndSdS(sºIndicates whether we have a working save_to_stream or save_to_file method (ie, whether we can save to files). Default method checks that one of these two methods has been overridden.s _rox_defaultiiN(shasattrsselfssave_to_streams save_to_file(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyscan_save_to_fileØs cCs@t|idƒ odSnt|idƒ odSndSdS(sÅIndicates whether we have a working save_to_stream or save_to_selection method (ie, whether we can save to selections). Default methods checks that one of these two methods has been overridden.s _rox_defaultiiN(shasattrsselfssave_to_streamssave_to_selection(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyscan_save_to_selectionás cCstdƒ‚dS(sÁIf you multitask during a save (using a recursive mainloop) then the user may click on the Cancel button. This function gets called if so, and should cause the recursive mainloop to return.s(Lazy programmer error: can't abort save!N(s Exception(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_cancelledës(s__name__s __module__s__doc__sNonessave_last_statsset_urissave_to_streams save_to_filessave_to_selections save_modessave_set_permissionss save_donesdiscards _rox_defaultscan_save_to_filescan_save_to_selectionssave_cancelled(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysSaveablehs   .        sSaveAreacBstZdZeZeZeZd„Zd„Zd„Z ed„Z d„Z d„Z d„Z d„Zd „Zd „Zd „Zd „ZRS( soA SaveArea contains the widgets used in a save box. You can use this to put a savebox area in a larger window.cs³tiiˆtdƒ|ˆ_|ˆ_ˆi|ƒ}ˆi |t t dƒ|i ƒtiƒ}|id‡d†ƒ|ˆ_ˆi |tt dƒ|iƒ|i|ƒdS(sÈ'document' must be a subclass of Saveable. 'uri' is the file's current location, or a simple name (eg 'TextFile') if it has never been saved. 'type' is the MIME-type to use (eg 'text/plain'). isactivatecs ˆiƒS(N(sselfssave_to_file_in_entry(sw(sself(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys siN(sgsVBoxs__init__sselfsFalsesdocumentsuris initial_uris_create_drag_areastypes drag_areas pack_startsTruesshow_allsEntrysentrysconnectsshowsset_text(sselfsdocumentsuristypes drag_areasentry((sselfsT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys__init__ùs      cCsDt|ƒ}|o|ii|ƒn|iititi ƒdS(N( simage_for_typestypespixbufsselfsiconsset_from_pixbufsset_from_stocksgsSTOCK_MISSING_IMAGEs ICON_SIZE_DND(sselfstypespixbuf((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys _set_icons cCsótiƒ}|iddddƒtiƒ|_|iidƒ|iit i ƒ|i |iƒti ƒ|_ |i|ƒ|i|ƒ|iid|iƒ|iid|iƒ|iid|iƒd|_|ii |i ƒ|SdS(Nf0.5iis drag_beginsdrag_ends drag_data_get(sgs AlignmentsalignssetsEventBoxsselfsdrag_boxsset_border_widths add_eventssgdksBUTTON_PRESS_MASKsaddsImagesicons _set_iconstypes_set_drag_sourcesconnects drag_beginsdrag_ends drag_data_getsdrag_in_progress(sselfstypesalign((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_create_drag_areas    cCs?|o|ii|iƒƒn|i|ƒ|i|ƒdS(sChange the icon and drag target to 'type'. If 'icon' is given (as a GtkImage) then that icon is used, otherwise an appropriate icon for the type is used.N(siconsselfsset_from_pixbufs get_pixbufs _set_iconstypes_set_drag_source(sselfstypesicon((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_type-s  cCs¯|iiƒoddtfg}ng}|iiƒo&||dtfddtfg}n| otd|iƒ‚n|i i t i t i B|t it iBƒdS(NsXdndDirectSave0isapplication/octet-streamsDocument %s can't save!(sselfsdocumentscan_save_to_files TARGET_XDSstargetsscan_save_to_selectionstypes TARGET_RAWs Exceptionsdrag_boxsdrag_source_setsgdks BUTTON1_MASKs BUTTON3_MASKs ACTION_COPYs ACTION_MOVE(sselfstypestargets((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys_set_drag_source7s&cCsº|iiƒ}tt|ƒƒ}|o{|i|ƒ odSnyM|it ƒz|i i |ƒWd|it ƒX|i |ƒ|iƒWq¶tƒq¶XntitdƒƒdS(s;Call this when the user clicks on an OK button you provide.Ns>Drag the icon to a directory viewer (or enter a full pathname)(sselfsentrysget_textsurisget_local_pathsescapespathsconfirm_new_paths set_sensitivesFalsesdocuments save_to_filesTruesset_uris save_dones_report_save_errorsroxsinfos_(sselfsurispath((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_to_file_in_entryFs"  cCs×d|_d|_d|_d|_y+|iiƒ}|o|i |ƒnWndk }|i ƒnX|i i ƒ}|o8|idƒ}|djo |}qÆ||d}n tdƒ}t||ƒdS(Niis/iÿÿÿÿsUnnamed(sselfsdrag_in_progresssdestroy_on_drag_ends using_xdss data_sentsicons get_pixbufspixbufsdrag_boxsdrag_source_set_icon_pixbufs tracebacks print_excsentrysget_textsurisrfindsisleafs_s_write_xds_propertyscontext(sselfsdrag_boxscontextsleafsis tracebackspixbufsuri((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys drag_begin\s&        c Cs|tjo—y6|itƒz|ii|ƒWd|itƒXWnt ƒt |t ƒdSnXd|_ t |t ƒ|io d|_n |iƒdSn-|tjot |t ƒtdƒdSnd}t|tƒ}|o¯tt|ƒƒ}|oŒ|i|ƒ o d}q—y?|itƒz|ii|ƒWd|itƒXt|_ Wnt ƒt|_ nX|i o d}q—q±d}ntdddd ƒ|i|id |ƒ|djot |t ƒ|i|ƒn|i o|iƒndS( NisBad target requested!sEsSsFs Remote application wants to use s"Direct Save, but I can't read the s"XdndDirectSave0 (type text/plain) s property.i(sinfos TARGET_RAWsselfs set_sensitivesFalsesdocumentssave_to_selectionsselection_datasTrues_report_save_errors_write_xds_propertyscontextsNones data_sentsdrag_in_progresssdestroy_on_drag_ends save_dones TARGET_XDSsalertsto_sends_read_xds_propertysurisget_local_pathsescapespathsconfirm_new_paths save_to_filessetstargetsset_uri( sselfswidgetscontextsselection_datasinfostimesuristo_sendspath((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys drag_data_getvs`                     cCsœtii|ƒ otSntii|ƒotitdƒ|ƒtSn||i jo|i i t jotSn|i i }ti|ƒ}g}|i|ijo'|itdƒ|i|ifƒn|i|ijo'|itdƒ|i|ifƒn|i|ijo|itdƒƒn| otSntid|di|ƒftiƒSntitdƒ|titdƒƒSd S( sUser wants to save to this path. If it's different to the original path, check that it doesn't exist and ask for confirmation if it does. If document.save_last_stat is set, compare with os.stat for an existing file and warn about changes. Returns true to go ahead with the save.s#'%s' already exists as a directory.s"Permissions changed from %o to %o.s Size was %d bytes; now %d bytes.sModification time changed.seFile '%s' edited by another program since last load/save. Really save (discarding other changes)? %ss s)File '%s' already exists -- overwrite it?s _OverwriteN(sosspathsexistssTruesisdirsroxsalerts_sFalsesselfs initial_urisdocumentssave_last_statsNoneslastsstatsmsgsst_modesappendsst_sizesst_mtimesconfirmsjoinsgs STOCK_DELETE(sselfspathslastsstatsmsg((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysconfirm_new_path¼s0 ''cCsStt|ƒƒ}|tj oti|ƒ|i_ n|ii |p|ƒdS(sData is safely saved somewhere. Update the document's URI and save_last_stat (for local saves). URI is not escaped. Internal.N( sget_local_pathsescapesurispathsNonesossstatsselfsdocumentssave_last_statsset_uri(sselfsurispath((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_uriÝs  cCs%d|_|io|iƒndS(Ni(sselfsdrag_in_progresssdestroy_on_drag_ends save_done(sselfswidgetscontext((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysdrag_endås  cCs|iiƒdS(N(sselfsdocuments save_done(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys save_doneês(s__name__s __module__s__doc__sNonesdocumentsentrys initial_uris__init__s _set_icons_create_drag_areasset_types_set_drag_sourcessave_to_file_in_entrys drag_begins drag_data_getsconfirm_new_pathsset_urisdrag_ends save_done(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysSaveAreañs        F !  sSaveBoxcBsDtZdZeZdeed„Zed„Zd„Zd„Z RS(sA SaveBox is a GtkDialog that contains a SaveArea and, optionally, a Discard button. Calls rox.toplevel_(un)ref automatically. s text/plainc s6tiiˆd|ƒˆitƒˆititi ƒˆiti ti ƒˆi ti ƒˆo¶tiƒ} ‡‡d†} tititdƒƒ}| i|ttdƒ|id| ƒ|itiƒ|itiƒˆii| ttdƒˆii| dƒ| i ƒnˆi!tdƒƒˆi"ti#ƒˆi$dd ƒˆi%d ƒˆi&dƒd t'f‡‡‡d †ƒY} | ˆ||ƒ} | ˆ_,| i ƒˆi-ƒ|i.d ƒ}|d }| i0i1ƒti2i3| i0|dƒ‡‡d†}ˆid|ƒti5ƒˆidd„ƒdS(s·See SaveArea.__init__. parent was added in version 2.0.5. To support older versions, use set_transient_for. If discard is True then an extra discard button is added to the dialog.sparentcsˆiƒˆiƒdS(N(sdocumentsdiscardsselfsdestroy(sevent(sselfsdocument(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysdiscard_clickeds s_DiscardisclickedisSave As:ssaveboxsSaveboxis BoxedAreacs2tZ‡‡d†Z‡‡d†Z‡d†ZRS(Ncs)ti||ƒˆoˆiƒndS(N(sSaveAreasset_urisareasurisdiscardsdocument(sareasuri(sdiscardsdocument(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_uriscsˆiƒˆiƒdS(N(sdocuments save_donesselfsdestroy(sarea(sselfsdocument(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys save_dones cs0ˆio"ˆi| ƒti||ƒndS(N(sselfswindowsset_save_in_progresss sensitivesSaveAreas set_sensitivesarea(sareas sensitive(sself(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys set_sensitives (s__name__s __module__sset_uris save_dones set_sensitive((sselfsdiscardsdocument(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys BoxedAreass/iÿÿÿÿcs©ˆio*yˆiƒWntiƒnXdSn|tti ƒjoˆi ƒnN|tti ƒjoˆi i ƒn'|ttiƒjon tdƒ‚dS(NsUnknown response!(sselfssave_in_progresssdocumentssave_cancelledsroxsreport_exceptionsresponsesintsgsRESPONSE_CANCELsdestroys RESPONSE_OKs save_areassave_to_file_in_entrysRESPONSE_DELETE_EVENTs Exception(swidgetsresponse(sselfsdocument(sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys got_response0s sresponsesdestroycCs tiƒS(N(sroxstoplevel_unref(sw((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysBsN(6sgsDialogs__init__sselfsparentsset_has_separatorsFalses add_buttons STOCK_CANCELsRESPONSE_CANCELs STOCK_SAVEs RESPONSE_OKsset_default_responsesdiscards HButtonBoxs discard_areasdiscard_clickedsroxs ButtonMixeds STOCK_DELETEs_sbuttons pack_startsTruesconnects unset_flagss CAN_FOCUSs set_flagss CAN_DEFAULTsvboxspack_ends reorder_childsshow_alls set_titles set_positions WIN_POS_MOUSEs set_wmclasssset_border_widthsset_save_in_progresssSaveAreas BoxedAreasdocumentsuristypes save_areasbuild_main_areasrfindsisentrys grab_focussEditables select_regions got_responses toplevel_ref( sselfsdocumentsuristypesdiscardsparentsis got_responsesbuttons BoxedAreasdiscard_clickeds save_areas discard_area((sselfsdocumentsdiscardsT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys__init__ósF          cCs|ii||ƒdS(s'See SaveArea's method of the same name.N(sselfs save_areasset_typestypesicon(sselfstypesicon((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_typeDscCs|ii|iƒdS(sZPlace self.save_area somewhere in self.vbox. Override this for more complicated layouts.N(sselfsvboxsadds save_area(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysbuild_main_areaHscCs!|iti| ƒ||_dS(sÑCalled when saving starts and ends. Shade/unshade any widgets as required. Make sure you call the default method too! Not called if box is destroyed from a recursive mainloop inside a save_to_* function.N(sselfsset_response_sensitivesgs RESPONSE_OKs in_progressssave_in_progress(sselfs in_progress((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysset_save_in_progressMs( s__name__s __module__s__doc__sNones save_areasFalses__init__sset_typesbuild_main_areasset_save_in_progress(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pysSaveBoxís Q  s StringSavercBs tZdZd„Zd„ZRS(sGA very simple SaveBox which saves the string passed to its constructor.cCs#ti|||dƒ||_dS(s>'string' is the string to save. 'name' is the default filenames text/plainN(sSaveBoxs__init__sselfsnamesstring(sselfsstringsname((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys__init__WscCs|i|iƒdS(N(sstreamswritesselfsstring(sselfsstream((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_to_stream\s(s__name__s __module__s__doc__s__init__ssave_to_stream(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys StringSaverUs  s SaveFiltercBs5tZdZeZeZd„Zd„Zd„ZRS(s£This Saveable runs a process in the background to generate the save data. Any python streams can be used as the input to and output from the process. The output from the subprocess is saved to the output stream (either directly, for fileno() streams, or via another temporary file). If the process returns a non-zero exit status or writes to stderr, the save fails (messages written to stderr are displayed). cCs|tj oet|dƒo t|dƒo ||_q{dk}dk}|iƒ|_|i||iƒn t|_dS(sÅUse 'stream' as stdin for the process. If stream is not a seekable fileno() stream then it is copied to a temporary file at this point. If None, the child process will get /dev/null on stdin.sfilenosseekN( sstreamsNoneshasattrsselfsstdinstempfilesshutils TemporaryFiles copyfileobj(sselfsstreamstempfilesshutil((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys set_stdinns     cCsBdkl}||i|i|ƒ|_|iiƒt|_dS(N(sPipeThroughCommand( s processessPipeThroughCommandsselfscommandsstdinsstreamsprocessswaitsNone(sselfsstreamsPipeThroughCommand((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_to_stream~s   cCs(|iod|_|iiƒndS(s$Send SIGTERM to the child processes.iN(sselfsprocessskilledskill(sself((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pyssave_cancelled‡s  ( s__name__s __module__s__doc__sNonescommandsstdins set_stdinssave_to_streamssave_cancelled(((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys SaveFilter_s   (s__doc__sosssyssroxsalertsgs_sfilersescapeschoicessget_local_pathsbasedirsgdks TARGET_XDSs TARGET_RAWs_chmods_write_xds_propertys_read_xds_propertysimage_for_types_report_save_errors UserAborts AbortSavesSaveablesVBoxsSaveAreasDialogsSaveBoxs StringSavers SaveFilter(sSaveAreasroxsescapes_chmodsgdks StringSavers TARGET_XDSsbasedirsimage_for_types TARGET_RAWs_report_save_errorsfilersget_local_paths_write_xds_propertys AbortSaves_read_xds_propertysalertssyss_s SaveFiltersgsSaveablesSaveBoxschoicessos((sT/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/saving.pys?s$ %  %  ‰üh