COT package reference

The below documents describe in depth the code structure and APIs of COT. These are not generally of interest to the end users of the COT script, but are provided for reference of developers wishing to integrate the COT package directly into their code.

Package implementing the Common OVF Tool.

Utility modules

COT.data_validation Various helpers for data sanity checks.
COT.file_reference Wrapper classes to abstract away differences between file sources.
COT.utilities General-purpose utility functions for COT.
COT.xml_file Reading, editing, and writing XML files.

Sub-packages

COT.commands Package describing various operations COT can perform on a VM description.
COT.disks Package for handling various disk file types (VMDK, ISO, QCOW2, etc.).
COT.helpers Provides a common interface for interacting with various non-Python programs.
COT.platforms Package for identifying guest platforms and handling platform differences.
COT.ui Package providing common API for the COT user interface (UI) of whatever type.
COT.vm_description Support for various virtual machine description formats (OVF, OVA, etc.).

Note

The hierarchy of permissible imports between sub-packages is as follows:

COT.ui
   |
   +---> COT.commands
   |        |
   |        +---> COT.vm_description
   |        |        |
   |        |        +---> COT.platforms
   |        |        |
   |        +--------+---> COT.disks
   |        |                 |
   +--------+-----------------+---> COT.helpers

Thus, to avoid circular dependencies, none of the other sub-packages may import COT.ui - if they wish to interact with the UI in any way (e.g., COT.helpers prompting the user to confirm whether to try to install a helper program), this needs to be done with a callback object (e.g., COT.helpers.Helper.USER_INTERFACE) rather than an import of the other module.