XAProtocols Module
Classes:
A protocol for classes that can open an item at a given path (either in its default application or in an application whose PyXA object extends this class). |
|
A protocol for classes that can print a file at a given path (either in its default application or in an application whose PyXA object extends this class). |
|
A protocol for classes that can be copied to the clipboard. |
|
A protocol for classes that can be deleted via a |
|
A protocol for classes that can be treated the same as |
|
A protocol for classes that can be treated the same as |
|
A protocol for classes that can be printed. |
|
A meta-class for protocols that other classes can adhere to. |
|
A protocol for classes that can be selected via a |
|
A protocol for classes that can be shown via a |
- class PyXA.XAProtocols.XACanOpenPath[source]
Bases:
XAProtocolA protocol for classes that can open an item at a given path (either in its default application or in an application whose PyXA object extends this class).
Changed in version 0.0.8: Moved from XABase into XAProtocols
New in version 0.0.1.
Methods:
open(target)Opens the file/website at the given filepath/URL.
- open(target: str) Any[source]
Opens the file/website at the given filepath/URL.
Child classes of XACanOpenPath should redefine this method as necessary.
- Parameters:
target (str) – The path to a file or the URL to a website to open.
- Returns:
A reference to the opened document or element, or None if no document/element was created or it cannot be found
- Return type:
Any
New in version 0.0.1.
- class PyXA.XAProtocols.XACanPrintPath[source]
Bases:
XAProtocolA protocol for classes that can print a file at a given path (either in its default application or in an application whose PyXA object extends this class).
Changed in version 0.0.8: Moved from XABase into XAProtocols
New in version 0.0.1.
Methods:
print(target)Prints the file/website at the given filepath/URL.
- print(target: str) XACanPrintPath[source]
Prints the file/website at the given filepath/URL.
Child classes of XACanPrintPath should redefine this method as necessary.
- Parameters:
target (str) – The path to a file or the URL to a website to print.
- Returns:
A reference to the PyXA object that called this method.
- Return type:
New in version 0.0.1.
- class PyXA.XAProtocols.XAClipboardCodable[source]
Bases:
XAProtocolA protocol for classes that can be copied to the clipboard.
New in version 0.0.8.
Methods:
Gets a clipboard-codable representation of the object.
- class PyXA.XAProtocols.XACloseable[source]
Bases:
XAProtocolMethods:
close([save, location])Closes the object.
- class PyXA.XAProtocols.XADeletable[source]
Bases:
XAProtocolA protocol for classes that can be deleted via a
delete()method.Changed in version 0.0.8: Moved from XABase into XAProtocols
New in version 0.0.1.
Methods:
delete()Deletes the object.
- class PyXA.XAProtocols.XAImageLike[source]
Bases:
XAProtocolA protocol for classes that can be treated the same as
XAImage.New in version 0.1.0.
Methods:
Gets a representation of the object that can be used to initialize an
XAImageobject.
- class PyXA.XAProtocols.XAPathLike[source]
Bases:
XAProtocolA protocol for classes that can be treated the same as
XAPath.New in version 0.1.0.
Methods:
Gets a representation of the object that can be used to initialize an
XAPathobject.
- class PyXA.XAProtocols.XAPrintable[source]
Bases:
XAProtocolA protocol for classes that can be printed.
New in version 0.0.8.
Methods:
print([print_properties, show_dialog, ...])Prints the object.
- print(print_properties: dict | None = None, show_dialog: bool = True, new_thread=True) XAPrintable[source]
Prints the object.
Child classes of XAPrintable should override this method as necessary.
- Parameters:
show_dialog (bool, optional) – Whether to show the print dialog, defaults to True
print_properties (Union[dict, None], optional) – Properties to set for printing, defaults to None
- Returns:
A reference to the PyXA object that called this method.
- Return type:
New in version 0.0.8.
- class PyXA.XAProtocols.XAProtocol[source]
Bases:
objectA meta-class for protocols that other classes can adhere to.
- class PyXA.XAProtocols.XASelectable[source]
Bases:
XAProtocolA protocol for classes that can be selected via a
select()method.Changed in version 0.0.8: Moved from XABase into XAProtocols
New in version 0.0.1.
Methods:
select()Selects the object This may open a new window, depending on which kind of object and application it acts on.
- select() XASelectable[source]
Selects the object This may open a new window, depending on which kind of object and application it acts on.
Child classes of XASelectable should redefine this method as necessary.
- Returns:
A reference to the PyXA object that called this method.
- Return type:
New in version 0.0.1.
- class PyXA.XAProtocols.XAShowable[source]
Bases:
XAProtocolA protocol for classes that can be shown via a
show()method.Changed in version 0.0.8: Moved from XABase into XAProtocols
New in version 0.0.1.
Methods:
show()Shows the object.
- show() XAShowable[source]
Shows the object.
Child classes of XAShowable should redefine this method as necessary.
- Returns:
A reference to the PyXA object that called this method.
- Return type:
New in version 0.0.1.