From 2561fd445a4bd3d676c61b377fbaeddf68585e53 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Sun, 25 Oct 2020 12:03:58 -0500 Subject: [PATCH] Release 2.1.0 --- CHANGES.rst | 5 + MANIFEST.in | 3 - build.py | 4 +- setup.py | 2 +- virtualbox/__about__.py | 2 +- virtualbox/library.py | 211 ++++++++++++++++++++++++++++++++++++---- 6 files changed, 199 insertions(+), 28 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5ee3a53..bd52437 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changelog ========= +2.1.0 (10/25/2020) +---------------- + +* Added support for VirtualBox 6.1 + 2.0.0 (4/2/2019) ---------------- diff --git a/MANIFEST.in b/MANIFEST.in index 284acd4..1c221ab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,9 +3,6 @@ include *.rst include *.txt include *.py include LICENSE -include build_docs.py -include docs/Makefile -include docs/make.bat recursive-include docs *.rst *.py recursive-include tests *.py *.conf recursive-include tests/fixtures *.ova diff --git a/build.py b/build.py index 5af3b3c..795ab74 100644 --- a/build.py +++ b/build.py @@ -26,7 +26,7 @@ def to_string(value): LIB_IMPORTS = """\ -# Complete implementation of VirtualBox's COM API with a Pythoninc interface. +# Complete implementation of VirtualBox's COM API with a Pythonic interface. # # Note: Commenting, and API structure generation was carved from # VirtualBox project's VirtualBox.xidl Main API definition. @@ -678,7 +678,7 @@ def get_vbox_version(config_kmk): config = f.read() major = b"6" # re.search(b"VBOX_VERSION_MAJOR = (?P[\d])", config).groupdict()['major'] minor = b"1" # re.search(b"VBOX_VERSION_MINOR = (?P[\d])", config).groupdict()['minor'] - build = b"14" # re.search(b"VBOX_VERSION_BUILD = (?P[\d])", config).groupdict()['build'] + build = b"16" # re.search(b"VBOX_VERSION_BUILD = (?P[\d])", config).groupdict()['build'] return b".".join([major, minor, build]) diff --git a/setup.py b/setup.py index 3c665d6..c1166d0 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ maintainer=about["__maintainer__"], maintainer_email=about["__maintainer_email__"], url=about["__url__"], - description="Complete implementation of VirtualBox's COM API with a Pythoninc interface", + description="Complete implementation of VirtualBox's COM API with a Pythonic interface", long_description=open("README.rst").read(), license=about["__license__"], zip_safe=False, diff --git a/virtualbox/__about__.py b/virtualbox/__about__.py index 97016c5..caac80b 100644 --- a/virtualbox/__about__.py +++ b/virtualbox/__about__.py @@ -3,6 +3,6 @@ __author_email__ = "mjdorma+pyvbox@gmail.com" __maintainer__ = "Seth Michael Larson" __maintainer_email__ = "sethmichaellarson@gmail.com" -__version__ = "2.0.0" +__version__ = "2.1.0" __license__ = "Apache-2.0" __url__ = "https://github.com/sethmlarson/virtualbox-python" diff --git a/virtualbox/library.py b/virtualbox/library.py index a79a4bc..2e23da1 100644 --- a/virtualbox/library.py +++ b/virtualbox/library.py @@ -1,4 +1,4 @@ -# Complete implementation of VirtualBox's COM API with a Pythoninc interface. +# Complete implementation of VirtualBox's COM API with a Pythonic interface. # # Note: Commenting, and API structure generation was carved from # VirtualBox project's VirtualBox.xidl Main API definition. @@ -81,11 +81,11 @@ """ -vbox_version = "6.1.14" +vbox_version = "6.1.16" lib_version = 1.3 lib_app_uuid = "819B4D85-9CEE-493C-B6FC-64FFE759B3C9" lib_uuid = "d7569351-1750-46f0-936e-bd127d5bc264" -xidl_hash = "f6fc2decce1cdf49f616583addcd3ab4" +xidl_hash = "09a60b2cdcbf61f994e4eb01863c81d1" class VBoxErrorObjectNotFound(VBoxError): @@ -2106,7 +2106,7 @@ class PartitionType(Enum): .. describe:: linux_srv(307) - Linux /srv partition.. + Linux /srv partition. .. describe:: linux_plain_dm_crypt(308) @@ -2599,7 +2599,7 @@ class PartitionType(Enum): ("LinuxRootARM32", 304, """Linux root partition for ARM32."""), ("LinuxRootARM64", 305, """Linux root partition for ARM64 / AArch64."""), ("LinuxHome", 306, """Linux /home partition."""), - ("LinuxSrv", 307, """Linux /srv partition.."""), + ("LinuxSrv", 307, """Linux /srv partition."""), ("LinuxPlainDmCrypt", 308, """Linux plain dm-crypt partition."""), ("LinuxLUKS", 309, """Linux unitified key setup (LUKS) partition."""), ("LinuxReserved", 310, """Linux reserved partition."""), @@ -8303,17 +8303,33 @@ class VBoxEventType(Enum): See :py:class:`IClipboardFileTransferModeChangedEvent` IClipboardFileTransferModeChangedEvent. - .. describe:: on_cloud_provider_registered(105) + .. describe:: on_cloud_provider_list_changed(105) - See :py:class:`ICloudProviderRegisteredEvent` ICloudProviderRegisteredEvent. + See :py:class:`ICloudProviderListChangedEvent` . - .. describe:: last(106) + .. describe:: on_cloud_provider_registered(106) + + See :py:class:`ICloudProviderRegisteredEvent` . + + .. describe:: on_cloud_provider_uninstall(107) + + See :py:class:`ICloudProviderUninstallEvent` . + + .. describe:: on_cloud_profile_registered(108) + + See :py:class:`ICloudProfileRegisteredEvent` . + + .. describe:: on_cloud_profile_changed(109) + + See :py:class:`ICloudProfileChangedEvent` . + + .. describe:: last(110) Must be last event, used for iterations and structures relying on numerical event values. """ - __uuid__ = "d5d15e38-808d-11e9-aaac-4bc5d973ca37" + __uuid__ = "2ab7c196-f232-11ea-a5d2-83b96bc30bcc" _enums = [ ("Invalid", 0, """Invalid event, must be first."""), ( @@ -8709,13 +8725,33 @@ class VBoxEventType(Enum): """See :py:class:`IClipboardFileTransferModeChangedEvent` IClipboardFileTransferModeChangedEvent.""", ), ( - "OnCloudProviderRegistered", + "OnCloudProviderListChanged", 105, - """See :py:class:`ICloudProviderRegisteredEvent` ICloudProviderRegisteredEvent.""", + """See :py:class:`ICloudProviderListChangedEvent` .""", ), ( - "Last", + "OnCloudProviderRegistered", 106, + """See :py:class:`ICloudProviderRegisteredEvent` .""", + ), + ( + "OnCloudProviderUninstall", + 107, + """See :py:class:`ICloudProviderUninstallEvent` .""", + ), + ( + "OnCloudProfileRegistered", + 108, + """See :py:class:`ICloudProfileRegisteredEvent` .""", + ), + ( + "OnCloudProfileChanged", + 109, + """See :py:class:`ICloudProfileChangedEvent` .""", + ), + ( + "Last", + 110, """Must be last event, used for iterations and structures relying on numerical event values.""", ), ] @@ -19196,9 +19232,9 @@ class IHostDrivePartition(Interface): @property def number(self): """Get int value for 'number' - The number of the partition. - + The number of the partition. Represents the system number of the + partition, e.g. /dev/sdX in the linux, where X is the number + returned. """ ret = self._get_attr("number") return ret @@ -19225,7 +19261,7 @@ def type_p(self): """Get PartitionType value for 'type' A translation of :py:func:`IHostDrivePartition.type_mbr` and :py:func:`IHostDrivePartition.type_uuid` when possible, otherwise - set to :py:func:`PartitionType.unknown` . + set to :py:attr:`PartitionType.unknown` . """ ret = self._get_attr("type") return PartitionType(ret) @@ -19322,8 +19358,14 @@ def name(self): class IHostDrive(Interface): """ The IHostDrive interface represents the drive of the physical machine. - It is not complete medium description and, therefore, it is not IMedium - based. The interface is used just for getting a host drive partitions info. + It is not a complete medium description and, therefore, it is not IMedium + based. The interface is used to get information about a host drive and + its partitioning. + + The object operates in limited mode if the user cannot open the drive + and parse the partition table. In limited mode on the + :py:func:`IHostDrive.drive_path` and :py:func:`IHostDrive.model` + attributes can be accessed, the rest will fail with E_ACCESSDENIED. """ __uuid__ = "70e2e0c3-332c-4d72-b822-2db16e2cb31b" @@ -36895,7 +36937,11 @@ def set_integer(self, value): class IStringFormValue(IFormValue): - """""" + """ + Intnded for cases when a read-only string value is used to + display information and different string is to be used when + copying to the clipboard. + """ __uuid__ = "cb6f0f2c-8384-11e9-921d-8b984e28a686" __wsmap__ = "managed" @@ -36929,6 +36975,16 @@ def set_string(self, text): progress = IProgress(progress) return progress + @property + def clipboard_string(self): + """Get str value for 'clipboardString' + Intnded for cases when a read-only string value is used to + display information and different string is to be used when + copying to the clipboard. + """ + ret = self._get_attr("clipboardString") + return ret + class IChoiceFormValue(IFormValue): """""" @@ -37505,6 +37561,29 @@ def cloud_machine_list(self): ret = self._get_attr("cloudMachineList") return [ICloudMachine(a) for a in ret] + def read_cloud_machine_stub_list(self): + """Make the list of cloud machine stubs available via + :py:func:`cloud_machine_stub_list` attribute. + Like with :py:func:`get_cloud_machine` , the returned machines + are initiatally inaccessible and require a refresh to get + their data from the cloud. + + return progress of type :class:`IProgress` + Progress object to track the operation completion. + + """ + progress = self._call("readCloudMachineStubList") + progress = IProgress(progress) + return progress + + @property + def cloud_machine_stub_list(self): + """Get ICloudMachine value for 'cloudMachineStubList' + See :py:func:`read_cloud_machine_stub_list` . + """ + ret = self._get_attr("cloudMachineStubList") + return [ICloudMachine(a) for a in ret] + def add_cloud_machine(self, instance_id): """Adopt a running instance and register it as cloud machine. This is kinda like adding a local .vbox file as a local VM. @@ -38302,10 +38381,32 @@ def get_provider_by_name(self, provider_name): return provider +class ICloudProviderListChangedEvent(IEvent): + """ + Each individual provider that is installed or uninstalled is + reported as an :py:class:`ICloudProviderRegisteredEvent` . When + the batch is done this event is sent and listerns can get the + new list. + """ + + __uuid__ = "a54d9cca-f23f-11ea-9755-efd0f1f792d9" + __wsmap__ = "managed" + id = VBoxEventType.on_cloud_provider_list_changed + + @property + def registered(self): + """Get bool value for 'registered'""" + ret = self._get_attr("registered") + return ret + + class ICloudProviderRegisteredEvent(IEvent): - """""" + """ + A cloud provider was installed or uninstalled. + See also :py:class:`ICloudProviderListChangedEvent` . + """ - __uuid__ = "3d515696-eb98-11ea-96ac-8b4794b20214" + __uuid__ = "e28e227a-f231-11ea-9641-9b500c6d5365" __wsmap__ = "managed" id = VBoxEventType.on_cloud_provider_registered @@ -38320,3 +38421,71 @@ def registered(self): """Get bool value for 'registered'""" ret = self._get_attr("registered") return ret + + +class ICloudProviderUninstallEvent(IEvent): + """ + A cloud provider is about to be uninstalled. + Unlike :py:class:`ICloudProviderRegisteredEvent` this one is + waitable and is sent *before* an attempt is made to + uninstall a provider. Listerns should release references to the + provider and related objects if they have any, or the + uninstallation of the provider is going to fail because it's + still in use. + """ + + __uuid__ = "f01f1066-f231-11ea-8eee-33bb2afb0b6e" + __wsmap__ = "managed" + id = VBoxEventType.on_cloud_provider_can_uninstall + + @property + def id_p(self): + """Get str value for 'id'""" + ret = self._get_attr("id") + return ret + + +class ICloudProfileRegisteredEvent(IEvent): + """""" + + __uuid__ = "6a5e65ba-eeb9-11ea-ae38-73242bc0f172" + __wsmap__ = "managed" + id = VBoxEventType.on_cloud_profile_registered + + @property + def provider_id(self): + """Get str value for 'providerId'""" + ret = self._get_attr("providerId") + return ret + + @property + def name(self): + """Get str value for 'name'""" + ret = self._get_attr("name") + return ret + + @property + def registered(self): + """Get bool value for 'registered'""" + ret = self._get_attr("registered") + return ret + + +class ICloudProfileChangedEvent(IEvent): + """""" + + __uuid__ = "83795a4c-fce1-11ea-8a17-636028ae0be2" + __wsmap__ = "managed" + id = VBoxEventType.on_cloud_profile_changed + + @property + def provider_id(self): + """Get str value for 'providerId'""" + ret = self._get_attr("providerId") + return ret + + @property + def name(self): + """Get str value for 'name'""" + ret = self._get_attr("name") + return ret