def init_info(self): self.tree.AppendItem(self.tree.GetRootItem(), text='License', data=wx.TreeItemData({'req': 'lic'})) self.tree.AppendItem(self.tree.GetRootItem(), text='Info', data=wx.TreeItemData({'req': 'cor'})) # Do not use the configuration because it could have entries about # addons that aren't actually installed addons = coreaux_api.get_components_info()["addons"] for type_ in ('Extensions', 'Interfaces', 'Plugins'): typeitem = self.tree.AppendItem(self.tree.GetRootItem(), text=type_, data=wx.TreeItemData({ 'req': 'lst', 'type_': type_ })) for addon in addons[type_]: self.tree.AppendItem(typeitem, text=addon, data=wx.TreeItemData({ 'req': 'inf', 'type_': type_, 'addon': addon }))
def compose_list(self, type_): # Do not use the configuration because it could have entries about # addons that aren't actually installed info = coreaux_api.get_components_info()["addons"] self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('{}:\n'.format(type_)) for addon in info[type_]: config = coreaux_api.get_configuration()(type_)(addon) if config.get_bool('enabled'): self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText('\t{}\n'.format(addon)) else: self.textw.SetDefaultStyle(self.STYLE_ITALIC) self.textw.AppendText('\t{} [disabled]\n'.format(addon))
def init_info(self): self.tree.AppendItem(self.tree.GetRootItem(), text='License', data=wx.TreeItemData({'req': 'lic'})) self.tree.AppendItem(self.tree.GetRootItem(), text='Info', data=wx.TreeItemData({'req': 'cor'})) # Do not use the configuration because it could have entries about # addons that aren't actually installed addons = coreaux_api.get_components_info()["addons"] for type_ in ('Extensions', 'Interfaces', 'Plugins'): typeitem = self.tree.AppendItem(self.tree.GetRootItem(), text=type_, data=wx.TreeItemData({'req': 'lst', 'type_': type_})) for addon in addons[type_]: self.tree.AppendItem(typeitem, text=addon, data=wx.TreeItemData( {'req': 'inf', 'type_': type_, 'addon': addon}))
def compose_main_info(self): coreinfo = coreaux_api.get_core_info() self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('Core version: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(coreinfo.version) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nWebsite: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(coreinfo.website) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nAuthor: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText('Dario Giovannetti <*****@*****.**>') self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nContributors: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) try: contributors = coreinfo.contributors except AttributeError: pass else: for c in contributors: self.textw.AppendText('\n\t{}'.format(c)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\n\nInstalled components:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) cinfo = coreaux_api.get_components_info()["info"] for cname in cinfo: self.textw.AppendText('\n\t{} {} ({})'.format(cname, cinfo[cname].version, cinfo[cname].release_date))
def compose_main_info(self): coreinfo = coreaux_api.get_core_info() self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('Core version: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(coreinfo.version) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nWebsite: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(coreinfo.website) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nAuthor: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText('Dario Giovannetti <*****@*****.**>') self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nContributors: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) try: contributors = coreinfo.contributors except AttributeError: pass else: for c in contributors: self.textw.AppendText('\n\t{}'.format(c)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\n\nInstalled components:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) cinfo = coreaux_api.get_components_info()["info"] for cname in cinfo: self.textw.AppendText('\n\t{} {} ({})'.format( cname, cinfo[cname].version, cinfo[cname].release_date))
def compose_addon_info(self, type_, addon): info = { "Extensions": coreaux_api.import_extension_info, "Interfaces": coreaux_api.import_interface_info, "Plugins": coreaux_api.import_plugin_info, }[type_](addon) config = coreaux_api.get_configuration()(type_)(addon) self.textw.SetDefaultStyle(self.STYLE_HEAD) self.textw.AppendText('{}\n'.format(addon)) self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText('{}\n'.format(info.description)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nEnabled: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText('yes' if config.get_bool('enabled') else 'no') self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nVersion: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(info.version) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nWebsite: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(info.website) self.textw.SetDefaultStyle(self.STYLE_BOLD) if len(info.authors) > 1: self.textw.AppendText('\nAuthors:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) for a in info.authors: self.textw.AppendText('\n\t{}'.format(a)) else: self.textw.AppendText('\nAuthor: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) self.textw.AppendText(info.authors[0]) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nContributors:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) try: contributors = info.contributors except AttributeError: pass else: for c in contributors: self.textw.AppendText('\n\t{}'.format(c)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nComponent: ') self.textw.SetDefaultStyle(self.STYLE_NORMAL) cinfo = coreaux_api.get_components_info() cname = cinfo["addons"][type_][addon] component = cinfo["info"][cname] self.textw.AppendText('{} {} ({})'.format(cname, component.version, component.release_date)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nDependencies:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) try: deps = info.dependencies except AttributeError: pass else: for d in deps: self.textw.AppendText('\n\t{} {}.x'.format(*d)) self.textw.SetDefaultStyle(self.STYLE_BOLD) self.textw.AppendText('\nOptional dependencies:') self.textw.SetDefaultStyle(self.STYLE_NORMAL) try: opts = info.optional_dependencies except AttributeError: pass else: for o in opts: self.textw.AppendText('\n\t{} {}.x'.format(*o))