sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

alter groups on an existing machine (IMachine) #21

Closed jgander closed 7 years ago

jgander commented 10 years ago

Attempting to adjust the group for an already registered virtual machine, see example below:

import virtualbox vbox = virtualbox.VirtualBox() machine = vbox.find_machine('win7') -> <virtualbox.library_ext.machine.IMachine at 0x7f08108ed350> machine.groups -> [u'/'] type(machine.groups) -> list

At ths point the list cannot be appended, replace, pop etc.

mjdorma commented 10 years ago

This will probably require new tech under the IMachine interface defined in the library_ext sub module. Maybe a property which exposed an aggregated member that has the smarts to add and remove groups from a machine instance. (But implements the MutableSequence abc?).

sethmlarson commented 7 years ago

This is something I want to get into the next release.

sethmlarson commented 7 years ago

So I just did a little inspection and the .groups method doesn't return a list any more? It returns a str value?

sethmlarson commented 7 years ago

Seems like I'm correct that this is now a string value and is therefore editable. No helper needed! Closing this.