示例#1
0
def installSkinPart(param,actionId):
	metrixTools.log("Installing skinpart: "+param)
	item_id = ""
	item_name = ""
	item_type = ""
	author = ""
	date_modified = ""
	try:
		data = metrixCore.getWeb(metrixDefaults.URL_GET_SKINPART_META_UPDATE + "&id=" + str(param),False)
		dom = parseString(data)
		for entry in dom.getElementsByTagName('entry'):
			item_id = str(entry.getAttributeNode('id').nodeValue)
			item_name = str(entry.getAttributeNode('name').nodeValue)
			item_type = str(entry.getAttributeNode('type').nodeValue)
			author = str(entry.getAttributeNode('author').nodeValue)
			image_link = str(entry.getAttributeNode('image_link').nodeValue)
			date = str(entry.getAttributeNode('date').nodeValue)
			date_modified = str(entry.getAttributeNode('date_modified').nodeValue)
			if item_type == "bundle":
				metrix_SkinPartTools.installBundle(item_id,type,author)
			else:
				metrix_SkinPartTools.installSkinPart(item_id,item_type,author,image_link)
				showInfo(item_name+" "+_("successfully installed!"))
			
	except Exception, e:
		metrixTools.log("Error installing SkinPart",e)
		traceback.print_exc()
示例#2
0
def installSkinPart(param,actionId):
	metrixTools.log("Installing skinpart: "+param)
	item_id = ""
	item_name = ""
	item_type = ""
	author = ""
	date_modified = ""
	try:
		data = metrixCore.getWeb(metrixDefaults.URL_GET_SKINPART_META_UPDATE + "&id=" + str(param),False)
		dom = parseString(data)
		for entry in dom.getElementsByTagName('entry'):
			item_id = str(entry.getAttributeNode('id').nodeValue)
			item_name = str(entry.getAttributeNode('name').nodeValue)
			item_type = str(entry.getAttributeNode('type').nodeValue)
			author = str(entry.getAttributeNode('author').nodeValue)
			image_link = str(entry.getAttributeNode('image_link').nodeValue)
			date = str(entry.getAttributeNode('date').nodeValue)
			date_modified = str(entry.getAttributeNode('date_modified').nodeValue)
			if item_type == "bundle":
				metrix_SkinPartTools.installBundle(item_id,type,author)
			else:
				metrix_SkinPartTools.installSkinPart(item_id,item_type,author,image_link)
				showInfo(item_name+" "+_("successfully installed!"))
			
	except Exception, e:
		metrixTools.log("Error installing SkinPart",e)
		traceback.print_exc()
	def downloadSkinPart(self):
		metrixTools.callOnMainThread(self["isInstalled"].setText,"Installing...")
		try:
			id = self.currentid
			type = self.currenttype
			author = self.currentauthor
			type = str(self["menu"].l.getCurrentSelection()[0][7])
			image_link = str(self["menu"].l.getCurrentSelection()[0][13])
			if type == "bundle":
				metrix_SkinPartTools.installBundle(id)
			else:
				metrix_SkinPartTools.installSkinPart(id,type,author,image_link)
			getCatalog = True
			getEntry = True
			metrixTools.callOnMainThread(self["isInstalled"].setText,"Installation successful!")
		except Exception, e:
			metrixTools.log("Error installing SkinPart "+id,e)
			metrixTools.callOnMainThread(self["isInstalled"].setText,"Error during installation!")
示例#4
0
 def downloadSkinPart(self):
     self["isInstalled"].setText("Installing...")
     try:
         id = self.currentid
         type = self.currenttype
         author = self.currentauthor
         type = str(self["menu"].l.getCurrentSelection()[0][7])
         image_id = str(self["menu"].l.getCurrentSelection()[0][8])
         image_token = str(self["menu"].l.getCurrentSelection()[0][9])
         if type == "bundle":
             metrix_SkinPartTools.installBundle(id, type, author)
         else:
             metrix_SkinPartTools.installSkinPart(id, type, author, image_id, image_token)
         getCatalog = True
         getEntry = True
         self["isInstalled"].setText("Installation successful!")
     except Exception as e:
         print "[MyMetrix] " + str(e)
         traceback.print_exc()
         self["isInstalled"].setText("Error during installation!")
 def downloadSkinPart(self):
     self['isInstalled'].setText('Installing...')
     try:
         id = self.currentid
         type = self.currenttype
         author = self.currentauthor
         type = str(self['menu'].l.getCurrentSelection()[0][7])
         image_id = str(self['menu'].l.getCurrentSelection()[0][8])
         image_token = str(self['menu'].l.getCurrentSelection()[0][9])
         if type == 'bundle':
             metrix_SkinPartTools.installBundle(id, type, author)
         else:
             metrix_SkinPartTools.installSkinPart(id, type, author,
                                                  image_id, image_token)
         getCatalog = True
         getEntry = True
         self['isInstalled'].setText('Installation successful!')
     except Exception as e:
         print '[MyMetrix] ' + str(e)
         traceback.print_exc()
         self['isInstalled'].setText('Error during installation!')
示例#6
0
def installSkinPart(param, actionId):
    print '[MyMetrix] Installing skinpart: ' + param
    downloadurl = 'http://connect.mymetrix.de/store/api/?q=get.xml.skinpartxml&id='
    downloadmetaurl = 'http://connect.mymetrix.de/store/api/?q=get.xml.skinpartmeta&id='
    screenshotpath = 'http://connect.mymetrix.de/store/api/?q=get.pngresized&width=550'
    screenshotpath_v2 = 'http://connect.mymetrix.de/store/api/?q=v2.get.png&width=550&type=6'
    item_id = ''
    item_type = ''
    author = ''
    image_id = ''
    image_token = ''
    date_modified = ''
    try:
        data = metrixCore.getWeb(downloadmetaurl + str(param), False)
        dom = parseString(data)
        for entry in dom.getElementsByTagName('entry'):
            item_id = str(entry.getAttributeNode('id').nodeValue)
            item_name = str(entry.getAttributeNode('name').nodeValue)
            item_type = str(entry.getAttributeNode('type').nodeValue)
            author = str(entry.getAttributeNode('author').nodeValue)
            image_id = str(entry.getAttributeNode('image_id').nodeValue)
            image_token = str(entry.getAttributeNode('image_token').nodeValue)
            date = str(entry.getAttributeNode('date').nodeValue)
            try:
                date_modified = str(
                    entry.getAttributeNode('date_modified').nodeValue)
            except:
                date_modified = date

        if item_type == 'bundle':
            metrix_SkinPartTools.installBundle(item_id, type, author)
        else:
            metrix_SkinPartTools.installSkinPart(item_id, type, author,
                                                 image_id, image_token)
        showInfo(item_name + _(' successfully installed!'))
    except Exception as e:
        print '[MyMetrix] Error installing SkinPart'
        print '[MyMetrix] ' + str(e)
        traceback.print_exc()
示例#7
0
 def downloadSkinPart(self):
     metrixTools.callOnMainThread(self["isInstalled"].setText,
                                  "Installing...")
     try:
         id = self.currentid
         type = self.currenttype
         author = self.currentauthor
         type = str(self["menu"].l.getCurrentSelection()[0][7])
         image_link = str(self["menu"].l.getCurrentSelection()[0][13])
         if type == "bundle":
             metrix_SkinPartTools.installBundle(id)
         else:
             metrix_SkinPartTools.installSkinPart(id, type, author,
                                                  image_link)
         getCatalog = True
         getEntry = True
         metrixTools.callOnMainThread(self["isInstalled"].setText,
                                      "Installation successful!")
     except Exception, e:
         metrixTools.log("Error installing SkinPart " + id, e)
         metrixTools.callOnMainThread(self["isInstalled"].setText,
                                      "Error during installation!")
示例#8
0
def installSkinPart(param, actionId):
    print '[MyMetrix] Installing skinpart: ' + param
    downloadurl = 'http://connect.mymetrix.de/store/api/?q=get.xml.skinpartxml&id='
    downloadmetaurl = 'http://connect.mymetrix.de/store/api/?q=get.xml.skinpartmeta&id='
    screenshotpath = 'http://connect.mymetrix.de/store/api/?q=get.pngresized&width=550'
    screenshotpath_v2 = 'http://connect.mymetrix.de/store/api/?q=v2.get.png&width=550&type=6'
    item_id = ''
    item_type = ''
    author = ''
    image_id = ''
    image_token = ''
    date_modified = ''
    try:
        data = metrixCore.getWeb(downloadmetaurl + str(param), False)
        dom = parseString(data)
        for entry in dom.getElementsByTagName('entry'):
            item_id = str(entry.getAttributeNode('id').nodeValue)
            item_name = str(entry.getAttributeNode('name').nodeValue)
            item_type = str(entry.getAttributeNode('type').nodeValue)
            author = str(entry.getAttributeNode('author').nodeValue)
            image_id = str(entry.getAttributeNode('image_id').nodeValue)
            image_token = str(entry.getAttributeNode('image_token').nodeValue)
            date = str(entry.getAttributeNode('date').nodeValue)
            try:
                date_modified = str(entry.getAttributeNode('date_modified').nodeValue)
            except:
                date_modified = date

        if item_type == 'bundle':
            metrix_SkinPartTools.installBundle(item_id, type, author)
        else:
            metrix_SkinPartTools.installSkinPart(item_id, type, author, image_id, image_token)
        showInfo(item_name + _(' successfully installed!'))
    except Exception as e:
        print '[MyMetrix] Error installing SkinPart'
        print '[MyMetrix] ' + str(e)
        traceback.print_exc()