sugar-toolkit-gtk3/shell/view/devices/deviceview.py

12 lines
275 B
Python
Raw Normal View History

from sugar.graphics.canvasicon import CanvasIcon
def create(model):
name = 'view.devices.' + model.get_type()
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod.DeviceView(model)