def show_plugins(self, *args): '''Выводит на экран список установленных плагинов.''' dict_info_plugins = self._get_info_plugins() if not dict_info_plugins.__len__(): dialog(text=self.translation._(u'Нет установленных плагинов!'), title=self.title) return self._list_plugins = Lists(dict_items=dict_info_plugins, events_callback=self._action_plugin, flag='two_list_icon_check') card(self._list_plugins)
def show_plugins(self): '''Выводит на экран список установленных плагинов.''' dict_info_plugins = self._get_info_plugins() if not dict_info_plugins.__len__(): dialog( text=self.data.self.data.string_lang_not_install_plugin, title=self.title ) return self._list_plugins = Lists( dict_items=dict_info_plugins, events_callback=self._action_plugin, flag='two_list_icon_check' ) card(self._list_plugins)
def show_license(dialog, on_language): path_to_license = '{}/license/license_{}.rst'.format( self.directory, self.data.dict_language[on_language]) if not os.path.exists(path_to_license): dialog(text=self.data.string_lang_not_license, title=self.title) dialog.dismiss() return text_license = open(path_to_license).read() widget_license = RstDocument( text=text_license, background_color=self.data.alpha, underline_color=self.data.underline_rst_color) card(widget_license, size=(.9, .8)) dialog.dismiss()
def _show_info_plugin(self, name_plugin): '''Вызывается при клике на имя плагина из списка.''' if not os.path.exists('{}/libs/plugins/{}/README.rst'.format( self.directory, name_plugin)): dialog(text=self.translation._(u'Нет информации о плагине!'), title=name_plugin) else: info_plugin = open('{}/libs/plugins/{}/README.rst'.format( self.directory, name_plugin)).read() info_plugin = info_plugin.format( NAME_APP=self.title, VERSION=self.started_plugins[name_plugin]['plugin-version'], AUTHOR=self.started_plugins[name_plugin]['plugin-author'], MAIL=self.started_plugins[name_plugin]['plugin-mail'], ) # TODO: избавиться от использования RstDocument. widget_info = RstDocument(text=info_plugin, background_color=self.alpha, underline_color=self.underline_rst_color) card(widget_info, size=(.75, .6))
def _show_info_plugin(self, name_plugin): '''Вызывается при клике на имя плагина из списка.''' if not os.path.exists('{}/libs/plugins/{}/README.rst'.format( self.directory, name_plugin)): dialog( text=self.data.string_lang_not_info_plugin, title=name_plugin ) else: info_plugin = open('{}/libs/plugins/{}/README.rst'.format( self.directory, name_plugin)).read() info_plugin = info_plugin.format( NAME_APP=self.title, VERSION=self.started_plugins[name_plugin]['plugin-version'], AUTHOR=self.started_plugins[name_plugin]['plugin-author'], MAIL=self.started_plugins[name_plugin]['plugin-mail'], ) widget_info = RstDocument( text=info_plugin, background_color=self.data.alpha, underline_color=self.data.underline_rst_color ) card(widget_info, size=(.75, .6))
def options_popup(self, options_instance): def on_select(value): options_instance.value = value dialog.dismiss() options_list = [] for options in options_instance.options: options_list.append(options) options_list = Lists(list_items=options_list, flag='single_list', events_callback=on_select) dialog = card(options_list)
def _show_names_groups(self, name_contact): '''Выводит на экран окно со списком групп.''' def get_choice_group(name_group): groups_list.dismiss() self._add_contact_in_group(name_contact, name_group) if not self.info_groups.__len__(): Snackbar.make(self.data.string_lang_list_groups_empty) return groups_list = \ [[name_group, 'accounts'] for name_group in self.info_groups.keys()] groups_list = Lists(list_items=groups_list, events_callback=get_choice_group, flag='single_list_icon') groups_list = card(groups_list, self.data.string_lang_add_in_group)