ooodev.adapter.util.url_transformer_partial module

class ooodev.adapter.util.url_transformer_partial.URLTransformerPartial(component, interface=com.sun.star.util.XURLTransformer)[source]

Bases: object

Partial class for XURLTransformer.

Parameters:
  • component (XURLTransformer) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.util.XURLTransformer)[source]

Constructor

Parameters:
  • component (XURLTransformer) – UNO Component that implements com.sun.star.util.XURLTransformer.XURLTransformer interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XURLTransformer.

Return type:

None

assemble(url)[source]

Assembles the parts of the URL specified by aURL and stores it into URL.Complete

Returns:

The first element is a flag indicating whether the assembling was successful. The second element is the assembled URL.

Return type:

Tuple[bool, URL]

Parameters:

url (com.sun.star.util.URL) –

get_presentation(url, with_password)[source]

Gets a representation of the URL for UI purposes only

Sometimes it can be useful to show a URL on an user interface in a more “human readable” form. Such URL can’t be used on any API call, but make it easier for the user to understand it.

Return type:

str

Parameters:
  • url (com.sun.star.util.URL) –

  • with_password (bool) –

parse_smart(url, smart_protocol)[source]

Parses the string in URL.Complete, which may contain a syntactically complete URL or is specified by the provided protocol

The implementation can use smart functions to correct or interpret URL.Complete if it is not a syntactically complete URL. The parts of the URL are stored in the other fields of aURL.

Returns:

The first element is a flag indicating whether the parsing was successful. The second element is the parsed URL.

Return type:

Tuple[bool, URL]

Parameters:
  • url (com.sun.star.util.URL) –

  • smart_protocol (str) –

parse_strict(url)[source]

Parses the string in URL.Complete which should contain a syntactically complete URL.

The implementation is allowed to correct minor failures in URL.Complete if the meaning of the URL remain unchanged. Parts of the URL are stored in the other fields of aURL.

Returns:

The first element is a flag indicating whether the parsing was successful. The second element is the parsed URL.

Return type:

Tuple[bool, URL]

Parameters:

url (com.sun.star.util.URL) –

ooodev.adapter.util.url_transformer_partial.get_builder(component)[source]

Get the builder for the component.

Parameters:

component (Any) – The component.

Returns:

Builder instance.

Return type:

DefaultBuilder