From 806af3ac341d26cd1e563641a113cad95854d9c3 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 3 Dec 2006 10:59:11 +0000 Subject: [PATCH] Moved into a sub-dir, so that a svn checkout has the same structure as ROX-Lib does in the 0install cache. This is a work-around for the fact that I used id='..' in the interface, but we're stuck with it now. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/rox-lib@4870 66de3db3-b00d-0410-b41b-f4738ad19bea --- .DirIcon => ROX-Lib2/.DirIcon | Bin AppInfo.xml => ROX-Lib2/AppInfo.xml | 0 AppRun => ROX-Lib2/AppRun | 2 +- {Help => ROX-Lib2/Help}/COPYING | 0 {Help => ROX-Lib2/Help}/Changes | 0 {Help => ROX-Lib2/Help}/Errors | 0 {Help => ROX-Lib2/Help}/README | 0 {Help => ROX-Lib2/Help}/TODO | 0 {Help => ROX-Lib2/Help}/findrox.py | 0 {Messages => ROX-Lib2/Messages}/de.po | 0 {Messages => ROX-Lib2/Messages}/dist | 0 {Messages => ROX-Lib2/Messages}/es.po | 0 {Messages => ROX-Lib2/Messages}/fr.po | 0 {Messages => ROX-Lib2/Messages}/hu.po | 0 {Messages => ROX-Lib2/Messages}/it.po | 0 {Messages => ROX-Lib2/Messages}/pl.po | 0 {Messages => ROX-Lib2/Messages}/pt_BR.po | 0 {Messages => ROX-Lib2/Messages}/update-po | 0 {Messages => ROX-Lib2/Messages}/zh_CN.po | 0 {Messages => ROX-Lib2/Messages}/zh_TW.po | 0 ROX-Lib2.xml => ROX-Lib2/ROX-Lib2.xml | 0 ROX-Lib2/python/check.sh | 3 + {python => ROX-Lib2/python}/make_docs.py | 0 {python => ROX-Lib2/python}/rox/AppInfo.py | 0 {python => ROX-Lib2/python}/rox/InfoWin.py | 0 {python => ROX-Lib2/python}/rox/Menu.py | 0 {python => ROX-Lib2/python}/rox/OptionsBox.py | 3 + {python => ROX-Lib2/python}/rox/__init__.py | 0 {python => ROX-Lib2/python}/rox/applet.py | 0 {python => ROX-Lib2/python}/rox/basedir.py | 0 {python => ROX-Lib2/python}/rox/choices.py | 0 {python => ROX-Lib2/python}/rox/debug.py | 0 {python => ROX-Lib2/python}/rox/filer.py | 0 {python => ROX-Lib2/python}/rox/fileutils.py | 0 {python => ROX-Lib2/python}/rox/i18n.py | 0 {python => ROX-Lib2/python}/rox/icon_theme.py | 0 {python => ROX-Lib2/python}/rox/launch.py | 0 {python => ROX-Lib2/python}/rox/loading.py | 0 {python => ROX-Lib2/python}/rox/master_proxy.py | 0 {python => ROX-Lib2/python}/rox/mime.py | 0 {python => ROX-Lib2/python}/rox/mime_handler.py | 0 {python => ROX-Lib2/python}/rox/options.py | 0 {python => ROX-Lib2/python}/rox/processes.py | 0 {python => ROX-Lib2/python}/rox/proxy.py | 0 {python => ROX-Lib2/python}/rox/saving.py | 11 +++- {python => ROX-Lib2/python}/rox/session.py | 1 + {python => ROX-Lib2/python}/rox/settings.py | 3 + {python => ROX-Lib2/python}/rox/su.py | 0 {python => ROX-Lib2/python}/rox/suchild.py | 0 {python => ROX-Lib2/python}/rox/suchild.sh | 0 {python => ROX-Lib2/python}/rox/tasks.py | 0 {python => ROX-Lib2/python}/rox/templates.py | 21 +++++-- ROX-Lib2/python/rox/uri_handler.py | 70 +++++++++++++++++++++ {python => ROX-Lib2/python}/rox/xattr.py | 2 +- {python => ROX-Lib2/python}/rox/xxmlrpc.py | 0 {tests => ROX-Lib2/tests}/python/testall.py | 0 {tests => ROX-Lib2/tests}/python/testbasedir.py | 0 {tests => ROX-Lib2/tests}/python/testchoices.py | 0 {tests => ROX-Lib2/tests}/python/testicon_theme.py | 0 {tests => ROX-Lib2/tests}/python/testmenu.py | 0 {tests => ROX-Lib2/tests}/python/testoptions.py | 0 {tests => ROX-Lib2/tests}/python/testprocesses.py | 0 {tests => ROX-Lib2/tests}/python/testproxy.py | 0 {tests => ROX-Lib2/tests}/python/testrox.py | 0 {tests => ROX-Lib2/tests}/python/testsu.py | 0 {tests => ROX-Lib2/tests}/python/testtasks.py | 0 {tests => ROX-Lib2/tests}/python/testxxmlrpc.py | 0 67 files changed, 106 insertions(+), 10 deletions(-) rename .DirIcon => ROX-Lib2/.DirIcon (100%) rename AppInfo.xml => ROX-Lib2/AppInfo.xml (100%) rename AppRun => ROX-Lib2/AppRun (95%) rename {Help => ROX-Lib2/Help}/COPYING (100%) rename {Help => ROX-Lib2/Help}/Changes (100%) rename {Help => ROX-Lib2/Help}/Errors (100%) rename {Help => ROX-Lib2/Help}/README (100%) rename {Help => ROX-Lib2/Help}/TODO (100%) rename {Help => ROX-Lib2/Help}/findrox.py (100%) rename {Messages => ROX-Lib2/Messages}/de.po (100%) rename {Messages => ROX-Lib2/Messages}/dist (100%) rename {Messages => ROX-Lib2/Messages}/es.po (100%) rename {Messages => ROX-Lib2/Messages}/fr.po (100%) rename {Messages => ROX-Lib2/Messages}/hu.po (100%) rename {Messages => ROX-Lib2/Messages}/it.po (100%) rename {Messages => ROX-Lib2/Messages}/pl.po (100%) rename {Messages => ROX-Lib2/Messages}/pt_BR.po (100%) rename {Messages => ROX-Lib2/Messages}/update-po (100%) rename {Messages => ROX-Lib2/Messages}/zh_CN.po (100%) rename {Messages => ROX-Lib2/Messages}/zh_TW.po (100%) rename ROX-Lib2.xml => ROX-Lib2/ROX-Lib2.xml (100%) create mode 100755 ROX-Lib2/python/check.sh rename {python => ROX-Lib2/python}/make_docs.py (100%) rename {python => ROX-Lib2/python}/rox/AppInfo.py (100%) rename {python => ROX-Lib2/python}/rox/InfoWin.py (100%) rename {python => ROX-Lib2/python}/rox/Menu.py (100%) rename {python => ROX-Lib2/python}/rox/OptionsBox.py (99%) rename {python => ROX-Lib2/python}/rox/__init__.py (100%) rename {python => ROX-Lib2/python}/rox/applet.py (100%) rename {python => ROX-Lib2/python}/rox/basedir.py (100%) rename {python => ROX-Lib2/python}/rox/choices.py (100%) rename {python => ROX-Lib2/python}/rox/debug.py (100%) rename {python => ROX-Lib2/python}/rox/filer.py (100%) rename {python => ROX-Lib2/python}/rox/fileutils.py (100%) rename {python => ROX-Lib2/python}/rox/i18n.py (100%) rename {python => ROX-Lib2/python}/rox/icon_theme.py (100%) rename {python => ROX-Lib2/python}/rox/launch.py (100%) rename {python => ROX-Lib2/python}/rox/loading.py (100%) rename {python => ROX-Lib2/python}/rox/master_proxy.py (100%) rename {python => ROX-Lib2/python}/rox/mime.py (100%) rename {python => ROX-Lib2/python}/rox/mime_handler.py (100%) rename {python => ROX-Lib2/python}/rox/options.py (100%) rename {python => ROX-Lib2/python}/rox/processes.py (100%) rename {python => ROX-Lib2/python}/rox/proxy.py (100%) rename {python => ROX-Lib2/python}/rox/saving.py (98%) rename {python => ROX-Lib2/python}/rox/session.py (99%) rename {python => ROX-Lib2/python}/rox/settings.py (98%) rename {python => ROX-Lib2/python}/rox/su.py (100%) rename {python => ROX-Lib2/python}/rox/suchild.py (100%) rename {python => ROX-Lib2/python}/rox/suchild.sh (100%) rename {python => ROX-Lib2/python}/rox/tasks.py (100%) rename {python => ROX-Lib2/python}/rox/templates.py (88%) create mode 100644 ROX-Lib2/python/rox/uri_handler.py rename {python => ROX-Lib2/python}/rox/xattr.py (99%) rename {python => ROX-Lib2/python}/rox/xxmlrpc.py (100%) rename {tests => ROX-Lib2/tests}/python/testall.py (100%) rename {tests => ROX-Lib2/tests}/python/testbasedir.py (100%) rename {tests => ROX-Lib2/tests}/python/testchoices.py (100%) rename {tests => ROX-Lib2/tests}/python/testicon_theme.py (100%) rename {tests => ROX-Lib2/tests}/python/testmenu.py (100%) rename {tests => ROX-Lib2/tests}/python/testoptions.py (100%) rename {tests => ROX-Lib2/tests}/python/testprocesses.py (100%) rename {tests => ROX-Lib2/tests}/python/testproxy.py (100%) rename {tests => ROX-Lib2/tests}/python/testrox.py (100%) rename {tests => ROX-Lib2/tests}/python/testsu.py (100%) rename {tests => ROX-Lib2/tests}/python/testtasks.py (100%) rename {tests => ROX-Lib2/tests}/python/testxxmlrpc.py (100%) diff --git a/.DirIcon b/ROX-Lib2/.DirIcon similarity index 100% rename from .DirIcon rename to ROX-Lib2/.DirIcon diff --git a/AppInfo.xml b/ROX-Lib2/AppInfo.xml similarity index 100% rename from AppInfo.xml rename to ROX-Lib2/AppInfo.xml diff --git a/AppRun b/ROX-Lib2/AppRun similarity index 95% rename from AppRun rename to ROX-Lib2/AppRun index 5277599..fd9e7a0 100755 --- a/AppRun +++ b/ROX-Lib2/AppRun @@ -23,7 +23,7 @@ box.set_title('ROX-Lib') box.set_position(g.WIN_POS_CENTER) box.set_default_response(g.RESPONSE_OK) -if box.run() == g.RESPONSE_HELP: +if box.run() == int(g.RESPONSE_HELP): from rox import filer import os.path filer.open_dir(os.path.join(app_dir, "Help")) diff --git a/Help/COPYING b/ROX-Lib2/Help/COPYING similarity index 100% rename from Help/COPYING rename to ROX-Lib2/Help/COPYING diff --git a/Help/Changes b/ROX-Lib2/Help/Changes similarity index 100% rename from Help/Changes rename to ROX-Lib2/Help/Changes diff --git a/Help/Errors b/ROX-Lib2/Help/Errors similarity index 100% rename from Help/Errors rename to ROX-Lib2/Help/Errors diff --git a/Help/README b/ROX-Lib2/Help/README similarity index 100% rename from Help/README rename to ROX-Lib2/Help/README diff --git a/Help/TODO b/ROX-Lib2/Help/TODO similarity index 100% rename from Help/TODO rename to ROX-Lib2/Help/TODO diff --git a/Help/findrox.py b/ROX-Lib2/Help/findrox.py similarity index 100% rename from Help/findrox.py rename to ROX-Lib2/Help/findrox.py diff --git a/Messages/de.po b/ROX-Lib2/Messages/de.po similarity index 100% rename from Messages/de.po rename to ROX-Lib2/Messages/de.po diff --git a/Messages/dist b/ROX-Lib2/Messages/dist similarity index 100% rename from Messages/dist rename to ROX-Lib2/Messages/dist diff --git a/Messages/es.po b/ROX-Lib2/Messages/es.po similarity index 100% rename from Messages/es.po rename to ROX-Lib2/Messages/es.po diff --git a/Messages/fr.po b/ROX-Lib2/Messages/fr.po similarity index 100% rename from Messages/fr.po rename to ROX-Lib2/Messages/fr.po diff --git a/Messages/hu.po b/ROX-Lib2/Messages/hu.po similarity index 100% rename from Messages/hu.po rename to ROX-Lib2/Messages/hu.po diff --git a/Messages/it.po b/ROX-Lib2/Messages/it.po similarity index 100% rename from Messages/it.po rename to ROX-Lib2/Messages/it.po diff --git a/Messages/pl.po b/ROX-Lib2/Messages/pl.po similarity index 100% rename from Messages/pl.po rename to ROX-Lib2/Messages/pl.po diff --git a/Messages/pt_BR.po b/ROX-Lib2/Messages/pt_BR.po similarity index 100% rename from Messages/pt_BR.po rename to ROX-Lib2/Messages/pt_BR.po diff --git a/Messages/update-po b/ROX-Lib2/Messages/update-po similarity index 100% rename from Messages/update-po rename to ROX-Lib2/Messages/update-po diff --git a/Messages/zh_CN.po b/ROX-Lib2/Messages/zh_CN.po similarity index 100% rename from Messages/zh_CN.po rename to ROX-Lib2/Messages/zh_CN.po diff --git a/Messages/zh_TW.po b/ROX-Lib2/Messages/zh_TW.po similarity index 100% rename from Messages/zh_TW.po rename to ROX-Lib2/Messages/zh_TW.po diff --git a/ROX-Lib2.xml b/ROX-Lib2/ROX-Lib2.xml similarity index 100% rename from ROX-Lib2.xml rename to ROX-Lib2/ROX-Lib2.xml diff --git a/ROX-Lib2/python/check.sh b/ROX-Lib2/python/check.sh new file mode 100755 index 0000000..86e9eda --- /dev/null +++ b/ROX-Lib2/python/check.sh @@ -0,0 +1,3 @@ +#!/bin/sh +rm rox/*.pyc +pychecker --no-miximport --no-argsused --classdoc rox/*.py | gvim - diff --git a/python/make_docs.py b/ROX-Lib2/python/make_docs.py similarity index 100% rename from python/make_docs.py rename to ROX-Lib2/python/make_docs.py diff --git a/python/rox/AppInfo.py b/ROX-Lib2/python/rox/AppInfo.py similarity index 100% rename from python/rox/AppInfo.py rename to ROX-Lib2/python/rox/AppInfo.py diff --git a/python/rox/InfoWin.py b/ROX-Lib2/python/rox/InfoWin.py similarity index 100% rename from python/rox/InfoWin.py rename to ROX-Lib2/python/rox/InfoWin.py diff --git a/python/rox/Menu.py b/ROX-Lib2/python/rox/Menu.py similarity index 100% rename from python/rox/Menu.py rename to ROX-Lib2/python/rox/Menu.py diff --git a/python/rox/OptionsBox.py b/ROX-Lib2/python/rox/OptionsBox.py similarity index 99% rename from python/rox/OptionsBox.py rename to ROX-Lib2/python/rox/OptionsBox.py index 9969d12..d259fda 100644 --- a/python/rox/OptionsBox.py +++ b/ROX-Lib2/python/rox/OptionsBox.py @@ -17,6 +17,9 @@ You can then create such a button in Options.xml with: +Any element may have a 'size-group' attribute. Certain widgets (labels in +particular) in the same size group all have the same size. + For widgets that have options, your build function will be called with the option as a third parameter. You should register get and set methods, and arrange for box.check_widget to be called when the user changes the diff --git a/python/rox/__init__.py b/ROX-Lib2/python/rox/__init__.py similarity index 100% rename from python/rox/__init__.py rename to ROX-Lib2/python/rox/__init__.py diff --git a/python/rox/applet.py b/ROX-Lib2/python/rox/applet.py similarity index 100% rename from python/rox/applet.py rename to ROX-Lib2/python/rox/applet.py diff --git a/python/rox/basedir.py b/ROX-Lib2/python/rox/basedir.py similarity index 100% rename from python/rox/basedir.py rename to ROX-Lib2/python/rox/basedir.py diff --git a/python/rox/choices.py b/ROX-Lib2/python/rox/choices.py similarity index 100% rename from python/rox/choices.py rename to ROX-Lib2/python/rox/choices.py diff --git a/python/rox/debug.py b/ROX-Lib2/python/rox/debug.py similarity index 100% rename from python/rox/debug.py rename to ROX-Lib2/python/rox/debug.py diff --git a/python/rox/filer.py b/ROX-Lib2/python/rox/filer.py similarity index 100% rename from python/rox/filer.py rename to ROX-Lib2/python/rox/filer.py diff --git a/python/rox/fileutils.py b/ROX-Lib2/python/rox/fileutils.py similarity index 100% rename from python/rox/fileutils.py rename to ROX-Lib2/python/rox/fileutils.py diff --git a/python/rox/i18n.py b/ROX-Lib2/python/rox/i18n.py similarity index 100% rename from python/rox/i18n.py rename to ROX-Lib2/python/rox/i18n.py diff --git a/python/rox/icon_theme.py b/ROX-Lib2/python/rox/icon_theme.py similarity index 100% rename from python/rox/icon_theme.py rename to ROX-Lib2/python/rox/icon_theme.py diff --git a/python/rox/launch.py b/ROX-Lib2/python/rox/launch.py similarity index 100% rename from python/rox/launch.py rename to ROX-Lib2/python/rox/launch.py diff --git a/python/rox/loading.py b/ROX-Lib2/python/rox/loading.py similarity index 100% rename from python/rox/loading.py rename to ROX-Lib2/python/rox/loading.py diff --git a/python/rox/master_proxy.py b/ROX-Lib2/python/rox/master_proxy.py similarity index 100% rename from python/rox/master_proxy.py rename to ROX-Lib2/python/rox/master_proxy.py diff --git a/python/rox/mime.py b/ROX-Lib2/python/rox/mime.py similarity index 100% rename from python/rox/mime.py rename to ROX-Lib2/python/rox/mime.py diff --git a/python/rox/mime_handler.py b/ROX-Lib2/python/rox/mime_handler.py similarity index 100% rename from python/rox/mime_handler.py rename to ROX-Lib2/python/rox/mime_handler.py diff --git a/python/rox/options.py b/ROX-Lib2/python/rox/options.py similarity index 100% rename from python/rox/options.py rename to ROX-Lib2/python/rox/options.py diff --git a/python/rox/processes.py b/ROX-Lib2/python/rox/processes.py similarity index 100% rename from python/rox/processes.py rename to ROX-Lib2/python/rox/processes.py diff --git a/python/rox/proxy.py b/ROX-Lib2/python/rox/proxy.py similarity index 100% rename from python/rox/proxy.py rename to ROX-Lib2/python/rox/proxy.py diff --git a/python/rox/saving.py b/ROX-Lib2/python/rox/saving.py similarity index 98% rename from python/rox/saving.py rename to ROX-Lib2/python/rox/saving.py index 10374c3..1927949 100644 --- a/python/rox/saving.py +++ b/ROX-Lib2/python/rox/saving.py @@ -8,7 +8,7 @@ the purpose and pass that to the SaveBox.""" import os, sys import rox from rox import alert, g, _, filer, escape -from rox import choices, get_local_path +from rox import choices, get_local_path, basedir gdk = g.gdk @@ -49,7 +49,11 @@ def image_for_type(type, size=48, flags=0): media, subtype = type.split('/', 1) - path = choices.load('MIME-icons', media + '_' + subtype + '.png') + path=basedir.load_first_config('rox.sourceforge.net', 'MIME-icons', + media + '_' + subtype + '.png') + if not path: + path = choices.load('MIME-icons', + media + '_' + subtype + '.png') icon=None if not path: icon_name = 'mime-%s:%s' % (media, subtype) @@ -64,6 +68,9 @@ def image_for_type(type, size=48, flags=0): print "Error loading MIME icon" if not path: + path = basedir.load_first_config('rox.sourceforge.net', + 'MIME-icons', media + '.png') + if not path: path = choices.load('MIME-icons', media + '.png') if path: if hasattr(gdk, 'pixbuf_new_from_file_at_size'): diff --git a/python/rox/session.py b/ROX-Lib2/python/rox/session.py similarity index 99% rename from python/rox/session.py rename to ROX-Lib2/python/rox/session.py index d6f5ad1..7ee0b0c 100644 --- a/python/rox/session.py +++ b/ROX-Lib2/python/rox/session.py @@ -126,3 +126,4 @@ if __name__=='__main__': control=get_session() control.ShowMessages() + diff --git a/python/rox/settings.py b/ROX-Lib2/python/rox/settings.py similarity index 98% rename from python/rox/settings.py rename to ROX-Lib2/python/rox/settings.py index bdd3bc8..c242079 100644 --- a/python/rox/settings.py +++ b/ROX-Lib2/python/rox/settings.py @@ -188,3 +188,6 @@ if __name__=='__main__': print '%s = %s' % (v, setobj.GetSetting(v)) v='Net/ThemeName' print '%s = %s' % (v, setobj.GetSetting(v)) + + print 'All: ', setobj.Enumerate() + print 'ROX: ', setobj.Enumerate('ROX/*') diff --git a/python/rox/su.py b/ROX-Lib2/python/rox/su.py similarity index 100% rename from python/rox/su.py rename to ROX-Lib2/python/rox/su.py diff --git a/python/rox/suchild.py b/ROX-Lib2/python/rox/suchild.py similarity index 100% rename from python/rox/suchild.py rename to ROX-Lib2/python/rox/suchild.py diff --git a/python/rox/suchild.sh b/ROX-Lib2/python/rox/suchild.sh similarity index 100% rename from python/rox/suchild.sh rename to ROX-Lib2/python/rox/suchild.sh diff --git a/python/rox/tasks.py b/ROX-Lib2/python/rox/tasks.py similarity index 100% rename from python/rox/tasks.py rename to ROX-Lib2/python/rox/tasks.py diff --git a/python/rox/templates.py b/ROX-Lib2/python/rox/templates.py similarity index 88% rename from python/rox/templates.py rename to ROX-Lib2/python/rox/templates.py index 5c05c82..dbb0457 100755 --- a/python/rox/templates.py +++ b/ROX-Lib2/python/rox/templates.py @@ -47,9 +47,11 @@ class Templates: """Load the glade file. If name is an absolute path name then load it, if a relative path name load that from the appdir or if None the load $APP_DIR/Templates.glade.""" - fname=_get_templates_file_name(name) + self.fname=_get_templates_file_name(name) - self.xml=file(fname, 'r').read() + # Ideally we should cache the file then generate the widgets + # using glade.xml_new_from_buffer(), but that is too buggy + #self.xml=file(self.fname, 'r').read() self.connect_to=None self.signals={} @@ -75,7 +77,7 @@ class Templates: connected at this point. """ - widgets=WidgetSet(self.xml, root) + widgets=WidgetSet(fname=self.fname, root) if self.connect_to: widgets.autoConnect(self.connect_to) for name in self.signals: @@ -85,14 +87,21 @@ class Templates: class WidgetSet: """A set of widget instances created from a glade file.""" - def __init__(self, xml, root=''): + def __init__(self, xml=None, fname=None, root=''): """A set of widget instances created from the glade file. xml - the contents of the glade file. + fname - file name to load the glade file from root - top level widget to create (and all is contained widgets), or '' to create all. + NOTE: one of xml or fname must be specified """ - - self.widgets=glade.xml_new_from_buffer(xml, len(xml), root) + + assert xml or fname + + if fname: + self.widgets=glade.XML(fname, root) + else: + self.widgets=glade.xml_new_from_buffer(xml, len(xml), root) def autoConnect(self, dict_or_instance): """Specify what to use to connect the signals. diff --git a/ROX-Lib2/python/rox/uri_handler.py b/ROX-Lib2/python/rox/uri_handler.py new file mode 100644 index 0000000..905d362 --- /dev/null +++ b/ROX-Lib2/python/rox/uri_handler.py @@ -0,0 +1,70 @@ +"""Look up or launch the handler for a URI. URIs are in the form scheme:other +and the handler for a given scheme is .rox.sourceforge.net/URI/scheme + +To open up a web page in the user's prefered web browser: + +import rox.uri_handler +try: + pid=rox.uri_handler.launch('http://rox.sourceforge.net/') +except: + # Try firefox instead + pid=os.spawnlp(os.P_NOWAIT, 'firefox', 'firefox', + 'http://rox.sourceforge.net/') + +os.waitpid(pid) + +""" + +import os, urlparse + +import rox +from rox import basedir + +def get(scheme): + """Return the handler for URI's of the named scheme (e.g. http, file, ftp, + etc.) The handler for file is always rox, otherwise it obtained from + ROX-Session. None is returned if no handler is defined or ROX-Session + could not be contacted. + + The returned string may contain %s in which case it should be replaced + with the URI, otherwise append the URI (after a space). + """ + + if scheme=='file': + return 'rox -U "%s"' + + path=basedir.load_first_config('rox.sourceforge.net', 'URI', scheme) + if not path: + return + + if rox.isappdir(path): + path=os.path.join(path, 'AppRun') + + return path + +def launch(uri): + """For a given URI pass it to the appropriate launcher. + rox.uri_handler.get() is used to look up the launcher command which is + executed. The process id of the command is returned (see os.wait()), or + None if no launcher is defined for that URI.""" + comp=urlparse.urlparse(uri) + handler=get(comp[0]) + if not handler: + return + if '%s' in handler: + cmd=handler % uri + else: + cmd=handler+' '+uri + #print cmd + + return os.spawnlp(os.P_NOWAIT, 'sh', 'sh', '-c', cmd) + +if __name__=='__main__': + print get('file') + print get('http') + print get('mailto') + print get('svn+ssh') + + launch('file:///tmp') + launch('http://rox.sf.net/') + diff --git a/python/rox/xattr.py b/ROX-Lib2/python/rox/xattr.py similarity index 99% rename from python/rox/xattr.py rename to ROX-Lib2/python/rox/xattr.py index e0bba3b..ba16ba6 100644 --- a/python/rox/xattr.py +++ b/ROX-Lib2/python/rox/xattr.py @@ -299,7 +299,7 @@ elif libc and hasattr(libc, 'getxattr'): """Check that name is a valid name for an extended attibute. False is returned if the name should not be used.""" - if '.' not in name or name[0]=='.': + if not name.startswith('user.'): return False return name_invalid_chars not in name diff --git a/python/rox/xxmlrpc.py b/ROX-Lib2/python/rox/xxmlrpc.py similarity index 100% rename from python/rox/xxmlrpc.py rename to ROX-Lib2/python/rox/xxmlrpc.py diff --git a/tests/python/testall.py b/ROX-Lib2/tests/python/testall.py similarity index 100% rename from tests/python/testall.py rename to ROX-Lib2/tests/python/testall.py diff --git a/tests/python/testbasedir.py b/ROX-Lib2/tests/python/testbasedir.py similarity index 100% rename from tests/python/testbasedir.py rename to ROX-Lib2/tests/python/testbasedir.py diff --git a/tests/python/testchoices.py b/ROX-Lib2/tests/python/testchoices.py similarity index 100% rename from tests/python/testchoices.py rename to ROX-Lib2/tests/python/testchoices.py diff --git a/tests/python/testicon_theme.py b/ROX-Lib2/tests/python/testicon_theme.py similarity index 100% rename from tests/python/testicon_theme.py rename to ROX-Lib2/tests/python/testicon_theme.py diff --git a/tests/python/testmenu.py b/ROX-Lib2/tests/python/testmenu.py similarity index 100% rename from tests/python/testmenu.py rename to ROX-Lib2/tests/python/testmenu.py diff --git a/tests/python/testoptions.py b/ROX-Lib2/tests/python/testoptions.py similarity index 100% rename from tests/python/testoptions.py rename to ROX-Lib2/tests/python/testoptions.py diff --git a/tests/python/testprocesses.py b/ROX-Lib2/tests/python/testprocesses.py similarity index 100% rename from tests/python/testprocesses.py rename to ROX-Lib2/tests/python/testprocesses.py diff --git a/tests/python/testproxy.py b/ROX-Lib2/tests/python/testproxy.py similarity index 100% rename from tests/python/testproxy.py rename to ROX-Lib2/tests/python/testproxy.py diff --git a/tests/python/testrox.py b/ROX-Lib2/tests/python/testrox.py similarity index 100% rename from tests/python/testrox.py rename to ROX-Lib2/tests/python/testrox.py diff --git a/tests/python/testsu.py b/ROX-Lib2/tests/python/testsu.py similarity index 100% rename from tests/python/testsu.py rename to ROX-Lib2/tests/python/testsu.py diff --git a/tests/python/testtasks.py b/ROX-Lib2/tests/python/testtasks.py similarity index 100% rename from tests/python/testtasks.py rename to ROX-Lib2/tests/python/testtasks.py diff --git a/tests/python/testxxmlrpc.py b/ROX-Lib2/tests/python/testxxmlrpc.py similarity index 100% rename from tests/python/testxxmlrpc.py rename to ROX-Lib2/tests/python/testxxmlrpc.py -- 2.11.4.GIT