from xii.validator import Bool

from xii.components.node import NodeAttribute


class GraphicAttribute(NodeAttribute):
    atype = "graphic"
    keys = Bool(True)
    defaults = True

    def spawn(self):
        if not self.settings():
            return
        xml = self.template('graphic.xml')
        self.add_xml('devices', xml.safe_substitute())

@@ -120,67 +120,451 @@
     
-atype = %22graphic%22%0A    keys = Bool(True)%0A    defaults = True
+%22%22%22Attach spice output to the created node.%0A    By simply adding the graphich line xii is instructed to add a vnc spice%0A    connection to the started node.%0A%0A    Currently only qxl/spice output is supported.%0A    %22%22%22%0A    atype = %22graphic%22%0A    keys = Bool(True)%0A    defaults = True%0A%0A    example = %22%22%22%0A    # vim: set ts=2 sw=2 tw=0 ft=yaml:%0A    ---%0A    with-graphic:%0A    type: node%0A    pool: default%0A%0A    image: %7B%7B image %7D%7D%0A%0A    graphic: yes%0A  %22%22%22
 %0A%0A  

Document nodes/attributes/graphic