;ò œbYFc@sªdZdkZdkZdkZeidƒZdddfZeiiei dƒZ eii e ƒZ e i dƒp e i dƒoeii e ƒei de:ƒƒWq^ei#i>e:ƒZ;q^Xn[:dei!fd„ƒYZ!dei?fd„ƒYZ?d ei@fd!„ƒYZAdaBdaCd"„ZDd#„ZEd$„ZFe%aGd%„ZHd&„ZId'„ZJd(„ZKe%aLd)e%d*„ZMe%aNe%d+„ZOd,„ZPd-„ZQy dkRZRWne1ed.ƒƒnXeiSd dd/fjoeiSdd0joeiid1eiSƒndS(2sàTo use ROX-Lib2 you need to copy the findrox.py script into your application directory and import that before anything else. This module will locate ROX-Lib2 and add ROX-Lib2/python to sys.path. If ROX-Lib2 is not found, it will display a suitable error and quit. Since the name of the gtk2 module can vary, it is best to import it from rox, where it is named 'g'. The AppRun script of a simple application might look like this: #!/usr/bin/env python import findrox; findrox.version(1, 9, 12) import rox window = rox.Window() window.set_title('My window') window.show() rox.mainloop() This program creates and displays a window. The rox.Window widget keeps track of how many toplevel windows are open. rox.mainloop() will return when the last one is closed. 'rox.app_dir' is set to the absolute pathname of your application (extracted from sys.argv). The builtin names True and False are defined to 1 and 0, if your version of python is old enough not to include them already. Nsutf-8iiis/AppRuns /AppletRunis¶Sorry, you need to have python 2.2, and it must be the default version. You may be able to change the first line of your program's AppRun file to end 'python2.2' as a workaround. sMessagess-s2.0svThe pygtk2 package (2.0.0 or later) must be installed to use this program: http://rox.sourceforge.net/desktop/ROX-Lib s:Broken pygtk installation: found pygtk (%s), but not gtk! cCsKy dk}Wn dSnXt|dƒ otitdƒtIJndS(NsversionsqWARNING from ROX-Lib: the version of findrox.py used by this application (%s) is very old and may cause problems.(sfindroxshasattrssyssstderrs_sapp_dir(sfindrox((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys_warn_old_findroxZs  cCs4|tjo ti}n||||||ƒdS(N( sfilesNonessyssstdouts showwarningsmessagescategorysfilenameslineno(smessagescategorysfilenameslinenosfiles showwarning((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys _stdout_warnfs s UserAbortcBstZdZed„ZRS(sWRaised when the user aborts an operation, eg by clicking on Cancel or pressing Escape.cCs!ti||p tdƒƒdS(Ns#Operation aborted at user's request(s Exceptions__init__sselfsmessages_(sselfsmessage((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys__init__ss (s__name__s __module__s__doc__sNones__init__(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys UserAbortps cCsjtƒtitdtiti|ƒ}|iti ƒ|i t dƒƒ|i ƒ|i ƒtƒdS(sEDisplay message in an error box. Return when the user closes the box.isErrorN(s toplevel_refsgs MessageDialogsNones MESSAGE_ERRORs BUTTONS_OKsmessagesboxs set_positionsWIN_POS_CENTERs set_titles_srunsdestroystoplevel_unref(smessagesbox((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysalertws!  sRA bug has been detected in this program. Please report the problem to the authors.cCsUyt|ƒ‚Wn>tiƒ\}}}dk}|i|||dt ƒnXdS(s6Display an error message and offer a debugging prompt.Ns auto_details( s Exceptionsmessagessyssexc_infostypesvaluestbsdebugsshow_exceptionsTrue(smessagestypesvaluesdebugstb((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysbugs cCst|ƒtidƒdS(s_Display message in an error box, then quit the program, returning with a non-zero exit status.iN(salertsmessagessyssexit(smessage((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pyscroak‹s cCsjtƒtitdtiti|ƒ}|iti ƒ|i t dƒƒ|i ƒ|i ƒtƒdS(sDDisplay informational message. Returns when the user closes the box.is InformationN(s toplevel_refsgs MessageDialogsNones MESSAGE_INFOs BUTTONS_OKsmessagesboxs set_positionsWIN_POS_CENTERs set_titles_srunsdestroystoplevel_unref(smessagesbox((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysinfo‘s!  cCsètƒtitdtiti|ƒ}|ot ||ƒ}nti d|ƒ}|i tiƒ|iƒ|i|tiƒ|itiƒ|itdƒƒ|itiƒ|iƒ}|iƒtƒ|ttiƒjSdS(sDisplay a / dialog. Result is true if the user chooses the action, false otherwise. If action is given then that is used as the text instead of the default for the stock item. Eg: if rox.confirm('Really delete everything?', g.STOCK_DELETE): delete() isstocksConfirm:N(s toplevel_refsgs MessageDialogsNonesMESSAGE_QUESTIONsBUTTONS_CANCELsmessagesboxsactions ButtonMixeds stock_iconsbuttonsButtons set_flagss CAN_DEFAULTsshowsadd_action_widgets RESPONSE_OKs set_positionsWIN_POS_CENTERs set_titles_sset_default_responsesrunsrespsdestroystoplevel_unrefsint(smessages stock_iconsactionsboxsbuttonsresp((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysconfirm›s"   cCs)tiƒ\}}}t|||ƒdS(s¸Display the current python exception in an error box, returning when the user closes the box. This is useful in the 'except' clause of a 'try' block. Uses rox.debug.show_exception().N(ssyssexc_infostypesvaluestbs _excepthook(stbstypesvalue((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysreport_exception³scCsft|||ƒt|ƒtjo t|tƒodSnto dk}|i |||ƒndS(N( s_old_excepthooksex_typesvaluestbstypes issubclasssKeyboardInterrupts have_displaysdebugsshow_exception(sex_typesvaluestbsdebug((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys _excepthookºs # s.DirIconsWindowcBstZdZd„ZRS(s¼This works in exactly the same way as a GtkWindow, except that it calls the toplevel_(un)ref functions for you automatically, and sets the window icon to /.DirIcon if it exists.cOsQttii||ƒtƒ|didtƒt o|di t ƒndS(Nisdestroy( sapplysgsWindows__init__sargsskwargss toplevel_refsconnectstoplevel_unrefs _window_iconsset_icon(sargsskwargs((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys__init__Òs (s__name__s __module__s__doc__s__init__(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysWindowÎs sDialogcBstZdZd„ZRS(s~This works in exactly the same way as a GtkDialog, except that it calls the toplevel_(un)ref functions for you automatically.cOs5ttii||ƒtƒ|didtƒdS(Nisdestroy( sapplysgsDialogs__init__sargsskwargss toplevel_refsconnectstoplevel_unref(sargsskwargs((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys__init__Ýs(s__name__s __module__s__doc__s__init__(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysDialogÚs s ButtonMixedcBstZdZd„ZRS(sˆA button with a standard stock icon, but any label. This is useful when you want to express a concept similar to one of the stock ones.cCsÌtii|ƒtidƒ}|i|ƒ|i|ƒti |ti ƒ}ti tdƒ}tiddddƒ}|i|ttdƒ|i|ttdƒ|i|ƒ|i|ƒ|iƒdS(sÃSpecify the icon and text for the new button. The text may specify the mnemonic for the widget by putting a _ before the letter, eg: button = ButtonMixed(g.STOCK_DELETE, '_Delete message').sif0.5f0.0iN(sgsButtons__init__sselfsLabelslabelsset_text_with_mnemonicsmessagesset_mnemonic_widgetsimage_new_from_stocksstocksICON_SIZE_BUTTONsimagesHBoxsFALSEsboxs Alignmentsaligns pack_startspack_endsaddsshow_all(sselfsstocksmessagesboxslabelsalignsimage((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys__init__ås    (s__name__s __module__s__doc__s__init__(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys ButtonMixedâs cCs9tdazxtotiƒqWWdtdaXdS(s®This is a wrapper around the gtk2.mainloop function. It only runs the loop if there are top level references, and exits when rox.toplevel_unref() reduces the count to zero.iN(s _in_mainloopss_toplevel_windowssgsmain(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysmainloopýs cCstdadS(swIncrement the toplevel ref count. rox.mainloop() won't exit until toplevel_unref() is called the same number of times.iN(s_toplevel_windows(((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys toplevel_ref scGsDtdjpt‚tdatdjototiƒndS(sßDecrement the toplevel ref count. If this is called while in rox.mainloop() and the count has reached zero, then rox.mainloop() will exit. Ignores any arguments passed in, so you can use it easily as a callback function.iiN(s_toplevel_windowssAssertionErrors _in_mainloopssgs main_quit(sunused((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pystoplevel_unrefs  cCsKdkl}totSny |ƒaWndatdƒnXtSdS(sÊTry to return the canonical name for this computer. This is used in the drag-and-drop protocol to work out whether a drop is coming from a remote machine (and therefore has to be fetched differently).(sgetfqdns localhosts ROX-Lib socket.getfqdn() failed!N(ssocketsgetfqdns _host_namesalert(sgetfqdn((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys our_host_names  cCs-dk}|idd„t|ƒdƒSdS(sConvert each space to %20, etcNs[^-:_./a-zA-Z0-9]cCsdt|idƒƒS(Ns%%%02xi(sordsmatchsgroup(smatch((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys/si(sressubs_to_utf8suri(surisre((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysescape+s   cCs8d|jo|Sndk}|idd„|ƒSdS(s Convert each %20 to a space, etcs%Ns%[0-9a-fA-F][0-9a-fA-F]cCs tt|idƒddƒƒS(Niii(schrsintsmatchsgroup(smatch((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys7s(surisressub(surisre((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysunescape2s   cCs5| otSn|ddjo›|dd!djot|ƒSn|iddƒ}|djotSn|djot|dƒSn|d|!}|tƒjot||ƒSq-nr|d iƒdjo*|dd!djot|dƒSq-n1|d d jp|d d jot|ƒSntSd S( sConvert 'uri' to a local path and return, if possible. If 'uri' is a resource on a remote machine, return None. URI is in the escaped form (%20 for space).is/iiiÿÿÿÿisfile:is./is../N( surisNonesunescapesfindsis remote_hosts our_host_nameslowersget_local_path(surisis remote_host((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysget_local_path:s(   "s Options.xmlcCs2t pt‚dkl}||||ƒadS(s«Most applications only have one set of options. This function can be used to set up the default group. 'program' is the name of the directory to use and 'leaf' is the name of the file used to store the group. You can refer to the group using rox.app_options. If site is given, the basedir module is used for saving options (the new system). Otherwise, the deprecated choices module is used. See rox.options.OptionGroup.(s OptionGroupN(s app_optionssAssertionErrorsoptionss OptionGroupsprogramsleafssite(sprogramsleafssites OptionGroup((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pyssetup_app_optionsUs  cCsŠtpt‚totiƒdSn| otiitdƒ}ndk }|i t|ƒad„}ti d|ƒti ƒdS(síEdit the app_options (set using setup_app_options()) using the GUI specified in 'options_file' (default /Options.xml). If this function is called again while the box is still open, the old box will be redisplayed to the user.Ns Options.xmlcCst|jpt‚tadS(N(s _options_boxswidgetsAssertionErrorsNone(swidget((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysclosedwssdestroy( s app_optionssAssertionErrors _options_boxspresents options_filesosspathsjoinsapp_dirs OptionsBoxsclosedsconnectsopen(s options_files OptionsBoxsclosed((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys edit_optionses   cCstii|ƒ otSntii|dƒ}tii|ƒ otii|ƒ otSny"ti|ƒ}ti|ƒ}Wnt j o tSnXti |ti ƒ otSn|itiii@otSn|itiii@otSn|i|ijSdS(sùReturn True if the path refers to a valid ROX AppDir. The tests are: - path is a directory - path is not world writable - path contains an executable AppRun - path/AppRun is not world writable - path and path/AppRun are owned by the same user.sAppRunN(sosspathsisdirsFalsesjoinsrunsisfilesislinksstatsspathssrunsOSErrorsaccesssX_OKsst_modesS_IWOTHsst_uid(spathsspathsrunssrun((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysisappdir~s$( c Cstii|ƒo¥tii|dƒ}ti|tiƒovdk}ti|ƒ}ti|ƒ}|i |i jo!|i |i @ o|i |i @ ot ii|ƒSq´q¸ndk}|i|ƒ}|o|Sndk}|i|ƒ}|o|iƒSndS(sµLooks up an icon for the file named by path, in the order below, using the first found: 1. The Filer's globicons file (not implemented) 2. A directory's .DirIcon file 3. A file in ~/.thumbnails whose name is the md5 hash of os.path.abspath(path), suffixed with '.png' 4. A file in $XDG_CONFIG_HOME/rox.sourceforge.net/MIME-Icons for the full type of the file. 5. An icon of the form 'gnome-mime-media-subtype' in the current GTK icon theme. 6. A file in $XDG_CONFIG_HOME/rox.sourceforge.net/MIME-Icons for the 'media' part of the file's type (eg, 'text') 7. An icon of the form 'gnome-mime-media' in the current icon theme. Returns a gtk.gdk.Pixbuf instance for the chosen icon. s.DirIconN(sosspathsisdirsjoinsdir_iconsaccesssR_OKsstatsdsisst_uidsIWOTHsst_modesgsgdkspixbuf_new_from_files thumbnails get_imagespixbufsmimesget_typesmimetypesget_icon( spathsmimetypesstatsdsispixbufsmimesdir_icons thumbnail((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pysget_icons"  7  s±You do not have the Python 'xml' module installed, which ROX-Lib2 requires. You need to install python-xmlbase (this is a small package; the full PyXML package is not required).ici sMYour version of pygtk (%d.%d.%d) is too old. Things might not work correctly.(Ts__doc__ssyssosscodecss getencoders_to_utf8sroxlib_versionspathsrealpathsargvs_pathsdirnamesapp_dirsendswithsTrues __builtin__sFalsesitersstderrswrites SystemExitsi18ns__file__s _roxlib_dirs translationsjoins_s _have_stdinspygtksrequiresgtksgs ImportErrorsWindowsAssertionErrorsgdksdisplay_get_defaultsNones have_displaysappends_warn_old_findroxswarningss _warningss showwarnings _stdout_warnsTRUEsFALSEs Exceptions UserAbortsalertsbugscroaksinfosconfirmsreport_exceptions _excepthooks excepthooks_old_excepthooks _icon_paths _window_iconsexistsswindow_set_default_icon_listspixbuf_new_from_filesDialogsButtons ButtonMixeds_toplevel_windowss _in_mainloopssmainloops toplevel_refstoplevel_unrefs _host_names our_host_namesescapesunescapesget_local_paths app_optionsssetup_app_optionss _options_boxs edit_optionssisappdirsget_iconsxmls pygtk_version(/s_old_excepthooks toplevel_refsmainloops __builtin__s ButtonMixedsreport_exceptionsWindowsunescapesescapesTRUEsxmls have_displaysconfirms _roxlib_dirs UserAborts our_host_namesgtks _stdout_warns _have_stdinsisappdirs_warn_old_findroxssetup_app_optionss _warningssget_icons _window_iconsapp_dirs _icon_pathsroxlib_versionspygtksalertssysstoplevel_unrefsDialogscodecssi18ns edit_optionssbugs_sinfos_to_utf8sFALSEs _excepthooksgsget_local_pathscroaksoss_path((sV/mnt/gmirror/ports/devel/py-roxlib/work/rox-lib2-2.0.5/ROX-Lib2/python/rox/__init__.pys?s®     *                    & .