A sophisticated g_file resolve



Hello,

I use gio via its Python's wrapper.

To manage simply all our URIs, i wrote this function:

class Folder
....

    def _get_g_file(self, uri):
        if type(uri) is not str:
            raise TypeError, 'unexpected "%s"' % repr(uri)
        if self._folder is None:
            return File(uri)

        return self._folder.resolve_relative_path(uri)

self._folder can be None => a new File with the given "uri"
or can be a File => we must resolve the uri to it.

The problem that "uri" can be an absolute path, a relative path or an
URI.
resolve_relative_path(uri) doesn't work with by example:
"file:///toto/tutu/".

How can i resolve my problem?
Do you plan to implement a resolve_path_or_uri function ?
Does this function already exists ?

By advance, thank you for your answer.

Best regards,
David V.

-- 
David Versmisse
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
_______________________________________________
Itaapy mailing list
Itaapy ikaaro org
http://mail.ikaaro.org/mailman/listinfo/itaapy


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]