Camel.URL

Fields

Name Type Access Description
authmech str r/w  
fragment str r/w  
host str r/w  
params GLib.Data r/w  
path str r/w  
port int r/w  
protocol str r/w  
query str r/w  
user str r/w  

Methods

class addrspec_end (in_, pos, inend, match)
class addrspec_start (in_, pos, inend, match)
class decode (part)
class decode_path (path)
class encode (part, escape_extra)
class file_end (in_, pos, inend, match)
class file_start (in_, pos, inend, match)
class new (url_string)
class web_end (in_, pos, inend, match)
class web_start (in_, pos, inend, match)
  copy ()
  equal (u2)
  free ()
  get_param (name)
  hash ()
  new_with_base (url_string)
  set_authmech (authmech)
  set_fragment (fragment)
  set_host (host)
  set_param (name, value)
  set_path (path)
  set_port (port)
  set_protocol (protocol)
  set_query (query)
  set_user (user)
  to_string (flags)

Details

class Camel.URL
classmethod addrspec_end(in_, pos, inend, match)
Parameters:
Return type:

bool

classmethod addrspec_start(in_, pos, inend, match)
Parameters:
Return type:

bool

classmethod decode(part)
Parameters:part (str) – a URL Camel.part

%-decodes the passed-in URL *in place*. The decoded version is never longer than the encoded version, so there does not need to be any additional space at the end of the string.

classmethod decode_path(path)
Parameters:path (str) –
Return type:str
classmethod encode(part, escape_extra)
Parameters:
  • part (str) – a URL Camel.part
  • escape_extra (str) – additional characters beyond ” "%#<>{}|\^[]`” to escape (or None)
Returns:

the encoded string

Return type:

str

This &percnt;-encodes the given URL Camel.part and returns the escaped version in allocated memory, which the caller must free when it is done.

classmethod file_end(in_, pos, inend, match)
Parameters:
Return type:

bool

classmethod file_start(in_, pos, inend, match)
Parameters:
Return type:

bool

classmethod new(url_string)
Parameters:url_string (str) – a URL string
Raises:GLib.Error
Returns:a Camel.URL if it can be parsed, or None otherwise
Return type:Camel.URL

Parses an absolute URL.

classmethod web_end(in_, pos, inend, match)
Parameters:
Return type:

bool

classmethod web_start(in_, pos, inend, match)
Parameters:
Return type:

bool

copy()
Returns:a duplicate copy of self
Return type:Camel.URL

Copy a Camel.URL.

equal(u2)
Parameters:u2 (Camel.URL) – the URL to compare
Returns:return True if the two urls are equal
Return type:bool
free()

Frees self.

get_param(name)
Parameters:name (str) – name of the param
Returns:the value of a param if found or None otherwise
Return type:str

Get the value of the specified param on the URL.

hash()
Returns:the url hash
Return type:int
new_with_base(url_string)
Parameters:url_string (str) – the URL
Returns:a parsed Camel.URL
Return type:Camel.URL

Parses url_string relative to self.

set_authmech(authmech)
Parameters:authmech (str) – authentication mechanism

Set the authmech of a Camel.URL.

set_fragment(fragment)
Parameters:fragment (str) – url fragment

Set the fragment of a Camel.URL.

set_host(host)
Parameters:host (str) – hostname

Set the hostname of a Camel.URL.

set_param(name, value)
Parameters:
  • name (str) – name of the param to set
  • value (str) – value of the param to set

Set a param on the Camel.URL.

set_path(path)
Parameters:path (str) – path

Set the path component of a Camel.URL.

set_port(port)
Parameters:port (int) – port

Set the port on a Camel.URL.

set_protocol(protocol)
Parameters:protocol (str) – protocol schema

Set the protocol of a Camel.URL.

set_query(query)
Parameters:query (str) – url query

Set the query of a Camel.URL.

set_user(user)
Parameters:user (str) – username

Set the user of a Camel.URL.

to_string(flags)
Parameters:flags (Camel.URLFlags) – additional translation options
Returns:a string representing self, which the caller must free
Return type:str

Flatten a Camel.URL into a string.