mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
056305d29b
* Use the _build_combo helper more * Un-static methods that don't need it * Use pretty labels more
28 lines
729 B
Python
28 lines
729 B
Python
#
|
|
# Copyright 2008-2009, 2013-2014 Red Hat, Inc.
|
|
# Cole Robinson <crobinso@redhat.com>
|
|
#
|
|
# This work is licensed under the GNU GPLv2 or later.
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
from .device import Device
|
|
from ..xmlbuilder import XMLProperty
|
|
|
|
|
|
class DeviceSound(Device):
|
|
XML_NAME = "sound"
|
|
|
|
MODEL_DEFAULT = "default"
|
|
MODELS = ["es1370", "sb16", "pcspk", "ac97", "ich6", "ich9"]
|
|
|
|
@staticmethod
|
|
def pretty_model(model):
|
|
ret = model.upper()
|
|
if model in ["ich6", "ich9"]:
|
|
ret = "HDA (%s)" % model.upper()
|
|
return ret
|
|
|
|
model = XMLProperty("./@model",
|
|
default_cb=lambda s: "es1370",
|
|
default_name=MODEL_DEFAULT)
|