comparison cagou/plugins/plugin_wid_widget_selector.py @ 312:772c170b47a9

Python3 port: /!\ Cagou now runs with Python 3.6+ Port has been done in the same way as for backend (check backend commit b2d067339de3 message for details).
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:14:22 +0200
parents 1b835bcfa663
children 19422bbd9c8e
comparison
equal deleted inserted replaced
311:a0d978d3ce84 312:772c170b47a9
29 from cagou.core import cagou_widget 29 from cagou.core import cagou_widget
30 from cagou import G 30 from cagou import G
31 31
32 32
33 PLUGIN_INFO = { 33 PLUGIN_INFO = {
34 "name": _(u"widget selector"), 34 "name": _("widget selector"),
35 "import_name": C.WID_SELECTOR, 35 "import_name": C.WID_SELECTOR,
36 "main": "WidgetSelector", 36 "main": "WidgetSelector",
37 "description": _(u"show available widgets and allow to select one"), 37 "description": _("show available widgets and allow to select one"),
38 "icon_medium": u"{media}/icons/muchoslava/png/selector_no_border_blue_44.png" 38 "icon_medium": "{media}/icons/muchoslava/png/selector_no_border_blue_44.png"
39 } 39 }
40 40
41 41
42 class WidgetSelItem(ButtonBehavior, BoxLayout): 42 class WidgetSelItem(ButtonBehavior, BoxLayout):
43 plugin_info = properties.DictProperty() 43 plugin_info = properties.DictProperty()
44 item = properties.ObjectProperty() 44 item = properties.ObjectProperty()
45 45
46 def on_release(self, *args): 46 def on_release(self, *args):
47 log.debug(u"widget selection: {}".format(self.plugin_info["name"])) 47 log.debug("widget selection: {}".format(self.plugin_info["name"]))
48 factory = self.plugin_info["factory"] 48 factory = self.plugin_info["factory"]
49 G.host.switchWidget(self, factory(self.plugin_info, None, profiles=iter(G.host.profiles))) 49 G.host.switchWidget(self, factory(self.plugin_info, None, profiles=iter(G.host.profiles)))
50 50
51 51
52 class WidgetSelector(cagou_widget.CagouWidget): 52 class WidgetSelector(cagou_widget.CagouWidget):