diff options
author | Vincent Vinet <vince.vinet@gmail.com> | 2009-03-26 17:53:15 (GMT) |
---|---|---|
committer | Vincent Vinet <vince.vinet@gmail.com> | 2009-03-31 14:03:01 (GMT) |
commit | c35bbc8c1e1ac93787f06d5f625d2c9a28127eb3 (patch) | |
tree | 55f639cd62aa61276efa6ccb4398cf90d22297e0 /src/sugar/tutorius/uam | |
parent | b108cc78b645f5a448f7274375215b80459bc9d2 (diff) |
Move uam into folder module
Diffstat (limited to 'src/sugar/tutorius/uam')
-rw-r--r-- | src/sugar/tutorius/uam/Makefile.am | 3 | ||||
-rw-r--r-- | src/sugar/tutorius/uam/__init__.py | 63 |
2 files changed, 66 insertions, 0 deletions
diff --git a/src/sugar/tutorius/uam/Makefile.am b/src/sugar/tutorius/uam/Makefile.am new file mode 100644 index 0000000..83d2119 --- /dev/null +++ b/src/sugar/tutorius/uam/Makefile.am @@ -0,0 +1,3 @@ +sugardir = $(pythondir)/sugar/tutorius/uam +sugar_PYTHON = \ + __init__.py diff --git a/src/sugar/tutorius/uam/__init__.py b/src/sugar/tutorius/uam/__init__.py new file mode 100644 index 0000000..b55ae28 --- /dev/null +++ b/src/sugar/tutorius/uam/__init__.py @@ -0,0 +1,63 @@ +# Copyright (C) 2009, Tutorius.org +# Copyright (C) 2009, Vincent Vinet <vince.vinet@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" +Universal addressing module + +Allows addressing Events, signals, widgets, etc for supported platforms +""" + +from urllib2 import urlparse + +SCHEMA="tap" #Tutorius Adressing Protocol + +SUBSCHEMAS = [ + "gtk", + "pygame", + "gobject", +] + +def __add_to_urlparse(name): + #Add to uses_netloc + if not name in urlparse.uses_netloc: + urlparse.uses_netloc.append(name) + + #Add to uses_relative + if not name in urlparse.uses_relative: + urlparse.uses_relative.append(name) + +# #Add to uses_params +# if not name in urlparse.uses_params: +# urlparse.uses_params.append(name) + + #Add to uses_query + if not name in urlparse.uses_query: + urlparse.uses_query.append(name) + + #Add to uses_frament + if not name in urlparse.uses_fragment: + urlparse.uses_fragment.append(name) + + +#Add schemas to urlparse +__add_to_urlparse(SCHEMA) + +for subschema in [".".join([SCHEMA,s]) for s in SUBSCHEMAS]: + __add_to_urlparse(subschema) + + +#For now, just export the urlparse urlparse method +parse_uri = urlparse.urlparse |