Infrastructure for the home page devices
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
sugardir = $(pkgdatadir)/shell/view/devices
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
battery.py \
|
||||
deviceview.py \
|
||||
network.py
|
||||
@@ -0,0 +1,6 @@
|
||||
from view.devices import deviceview
|
||||
|
||||
class DeviceView(deviceview.DeviceView)
|
||||
def __init__(self, model):
|
||||
deviceview.DeviceView.__init__(self, model)
|
||||
self.props.icon_name = 'theme:stock-close'
|
||||
@@ -0,0 +1,16 @@
|
||||
from sugar.graphics.canvasicon import CanvasIcon
|
||||
|
||||
class DeviceView(CanvasIcon):
|
||||
def __init__(self, model):
|
||||
CanvasIcon.__init__(self)
|
||||
self.model = model
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,6 @@
|
||||
from view.devices import deviceview
|
||||
|
||||
class DeviceView(deviceview.DeviceView):
|
||||
def __init__(self, model):
|
||||
deviceview.DeviceView.__init__(self, model)
|
||||
self.props.icon_name = 'theme:stock-close'
|
||||
Reference in New Issue
Block a user