def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Upgrade to %s") % self.rel_target, callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label="Run tool", callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Restore ownership to yourself"), callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Launch the Driver Manager"), callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Remove the conflicting packages."), callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Install the Multimedia Codecs"), callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] action = InfoReportAction(label=_("Launch Timeshift"), callback=self.launch_timeshift) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def get_actions(self): # Return available actions actions = [] if "cinnamon" in self.de or "xfce" in self.de: action = InfoReportAction(label=_("Add the XApp Status applet to the panel"), callback=self.callback) action.set_style(Gtk.STYLE_CLASS_SUGGESTED_ACTION) actions.append(action) return actions
def is_pertinent(self): # Defines whether this report should show up self.settings = Gio.Settings("com.linuxmint.dev") dismissed_pins = self.settings.get_strv("dismissed-pins") os.system("mkdir -p .tmp") os.system("rm -rf .tmp/*") mint_couples = ['tricia=bionic', 'sylvia=xenial'] is_pertinent = False for couple in mint_couples: (mint, ubuntu) = couple.split("=") mint = Release(mint) ubuntu = Release(ubuntu) find_pinned_packages(mint) find_ubuntu_updates(ubuntu) for mint_pkg in mint.packages: for ubuntu_pkg in ubuntu.packages: if ubuntu_pkg.name == mint_pkg.name: data = "%s=%s=%s" % (ubuntu_pkg.name, ubuntu_pkg.version, ubuntu.name) if data not in dismissed_pins: self.actions.append( InfoReportAction( label="Dismiss %s %s (%s)" % (ubuntu_pkg.name, ubuntu_pkg.version, ubuntu.name), callback=self.dismiss, data=data)) is_pertinent = True return is_pertinent
def is_pertinent(self): # Defines whether this report should show up self.settings = Gio.Settings("com.linuxmint.dev") os.system("mkdir -p .info-report") os.system("rm -rf .info-report/*") # Find the Mint version mint_version_str = find_mint_version("ulyana", "chromium") mint_version = mint_version_str.split("~")[0] # mint_version = mint_version_str current_version = parse_version(mint_version) # Find the latest versions of Chromium chromium_json = None broken = False self.beta_version_str = 0 self.release_version_str = 0 with urllib.request.urlopen( "https://omahaproxy.appspot.com/all.json") as f: try: chromium_json = json.loads(f.read()) except Exception as e: print(e) broken = True for platform in chromium_json: if platform["os"] == "linux": for version in platform["versions"]: if version["channel"] == "stable": self.release_version_str = version["version"] if version["channel"] == "beta": self.beta_version_str = version["version"] os.system("rm -rf .info-report") dismissed_releases = self.settings.get_strv("dismissed-releases") found_releases = False if parse_version( self.beta_version_str) > parse_version(mint_version) and ( "chromium-beta=%s" % self.beta_version_str) not in dismissed_releases: self.descriptions.append( "Version %s BETA is available upstream (Mint has %s)." % (self.beta_version_str, mint_version_str)) self.actions.append( InfoReportAction(label="Dismiss Chromium %s BETA" % self.beta_version_str, callback=self.dismiss_chromium_beta)) found_releases = True if parse_version( self.release_version_str) > parse_version(mint_version) and ( "chromium-release=%s" % self.release_version_str) not in dismissed_releases: self.descriptions.append( "Version %s RELEASE is available upstream (Mint has %s)." % (self.release_version_str, mint_version_str)) self.actions.append( InfoReportAction(label="Dismiss Chromium %s RELEASE" % self.release_version_str, callback=self.dismiss_chromium_release)) found_releases = True return found_releases