InstructionSVGWidgetCache Module

This module allows fast access to instruction SVGs.

class kniteditor.InstructionSVGWidgetCache.InstructionSVGWidgetCache(svg_cache=None)[source]

Bases: object

A chache to create widgets with instruction SVGs fast.

__init__(svg_cache=None)[source]

Create an InstructionSVGWidgetCache.

Parameters:svg_cache – an InstructionSVGCache or None if default_svg_cache shall be used
__weakref__

list of weak references to the object (if defined)

create_svg_widget(instruction, **kw)[source]

Create an SVGWidget for the instruction.

Parameters:
  • instruction – an Instruction
  • kw (dict) – they keyword arguments to pass to the widget
Return type:

SVGWidget

class kniteditor.InstructionSVGWidgetCache.SVGWidget(svg, **kwargs)[source]

Bases: kivy.uix.scatter.Scatter

This is the widget for an instruction to display.

__init__(svg, **kwargs)[source]

Render the instruction given as svg as a file name.

kniteditor.InstructionSVGWidgetCache.default_cache()[source]

Return the default InstructionSVGWidgetCache.

Return type:InstructionSVGWidgetCache.InstructionSVGWidgetCache