コード例 #1
0
	def removePackage(self):
		isinstalled = self["menu"].l.getCurrentSelection()[0][15]
		if isinstalled:
			self.updatestatus(_("Removing..."))
			packageName = metrixDefaults.cfg(metrixDefaults.CONFIG_INSTALLEDPACKAGES,self.currentid,"name")
			if not packageName == "":
				if metrix_PackageTools.uninstallPackage(packageName,id=self.currentid,silent=True):
					self.updatestatus(_("Successfully removed!"))
					time.sleep(2)
					self.getCatalog = True
					self.getEntry = True
				else:
					self.updatestatus(_("Error removing package!"))
			else:
				metrixDefaults.cfgremovesection(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id)
				self.updatestatus(_("Entry removed!"))
				time.sleep(2)
				self.getCatalog = True
				self.getEntry = True
コード例 #2
0
def uninstallPackage(packageName,id=0,silent=False):
	metrixTools.log("Uninstalling package "+packageName,None,"OpenStore")
	cmdStatus = runCommand("opkg remove '"+packageName+"'")
	if cmdStatus[0] == True: #Command without errorcode
		config.plugins.MetrixUpdater.Reboot.value = 1
		config.plugins.MetrixUpdater.save()    
		configfile.save()
		if not id == 0:
			metrixDefaults.cfgremovesection(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id)
		if not silent:
			metrixConnector.showInfo(cmdStatus[1])
		else:
			return True
	else:
		if not silent:
			metrixConnector.showInfo(_("Error uninstalling Package!"),MessageBox.TYPE_ERROR)
		else:
			return False
	syncPackages()
コード例 #3
0
	def removePackage(self):
		isinstalled = self["menu"].l.getCurrentSelection()[0][15]
		if isinstalled:
			self.updatestatus(_("Removing..."))
			packageName = metrixDefaults.cfg(metrixDefaults.CONFIG_INSTALLEDPACKAGES,self.currentid,"name")
			if not packageName == "":
				if metrix_PackageTools.uninstallPackage(packageName,id=self.currentid,silent=True):
					self.updatestatus(_("Successfully removed!"))
					time.sleep(2)
					self.getCatalog = True
					self.getEntry = True
				else:
					self.updatestatus(_("Error removing package!"))
			else:
				metrixDefaults.cfgremovesection(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id)
				self.updatestatus(_("Entry removed!"))
				time.sleep(2)
				self.getCatalog = True
				self.getEntry = True