gnomevfs.URI
gnomevfs.URI — Object encapsulating a URI
Constructor
gnomevfs.URI(text_uri)
text_uri: | A string representing the URI. |
| Returns: | the new gnomevfs.URI |
Methods
gnomevfs.URI.append_file_name
def append_file_name(file_name)
file_name: | The file name to append. |
| Returns: | The new URI. |
Create a new URI by appending file_name. This will add the appropriate directory separator if necessary.
gnomevfs.URI.append_path
def append_path(path)
path: | The path to append (unescaped) |
| Returns: | The new URI. |
Create a new URI by appending path. This will add the appropriate directory separator if necessary.
gnomevfs.URI.append_string
def append_string(path)
path: | The path to append (fully escaped) |
| Returns: | The new URI. |
Create a new URI by appending path. This will add the appropriate directory separator if necessary.
gnomevfs.URI.copy
def copy()
| Returns: | A copy of this URI. |
Create a copy of this URI.
gnomevfs.URI.is_parent
def is_parent(item, recursive)
item: | The item to search for. |
recursive: | Whether to check the entire hierarchy. |
| Returns: | True if item is a child of self. |
Check if this URI is a parent of item. If recursive is True, check the entire hierarchy.
gnomevfs.URI.resolve_relative
def resolve_relative(relative_reference)
relative_reference: | A string representing the (possibly) relative URI. |
| Returns: | The new URI. |
Create a new URI from relative_reference relative to self. The resolution algorithm follows RFC 2396. For details, see section 5.2 of http://www.ietf.org/rfc/rfc2396.txt .
In short, if the base uri ends in '/', relative_reference is appended to base, otherwise it replaces the part of base after the last '/'.