コード例 #1
0
ファイル: plugin.py プロジェクト: dpuschek/enigma2-plugins
	def save(self):
		lst = ['<?xml version="1.0" ?>\n<pluginsort>\n\n']
		append = lst.append
		extend = lst.extend

		idmap = reverse(WHEREMAP)
		for key in self.plugins.keys():
			whereplugins = self.plugins.get(key, None)
			if not whereplugins:
				continue

			where = idmap[key]
			extend((' <where type="', str(where), '">\n'))
			for key, value in iteritems(whereplugins):
				extend(('  <plugin name="', stringToXML(str(key)), '" weight="', str(value), '" />\n'))
			append((' </where>\n'))
		append('\n</pluginsort>\n')
		
		with open(XML_CONFIG, 'w') as config:
			config.writelines(lst)
コード例 #2
0
	def save(self):
		lst = ['<?xml version="1.0" ?>\n<pluginsort>\n\n']
		append = lst.append
		extend = lst.extend

		idmap = reverse(WHEREMAP)
		for key in self.plugins.keys():
			whereplugins = self.plugins.get(key, None)
			if not whereplugins:
				continue

			where = idmap[key]
			extend((' <where type="', str(where), '">\n'))
			for key, value in iteritems(whereplugins):
				extend(('  <plugin name="', stringToXML(str(key)), '" weight="', str(value), '" />\n'))
			append((' </where>\n'))
		append('\n</pluginsort>\n')
		
		with open(XML_CONFIG, 'w') as config:
			config.writelines(lst)