📄 configdownload.py
字号:
#!/usr/bin/python# -*- coding: iso-8859-15 -*-######################################################### This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published# by the Free Software Foundation; version 2 only.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.########################################################## # Project: AptOnCd# File: configDownload.py# Author: Alfredo Jr. <junix># Creation: 18/11/2006# Changed: 20/11/2006# Purpose: Config Class########################################################import configfrom xml.dom import minidomFILE = config.XML_CONTENTSdef load_config(file): _xml = minidom.parse(file) xml_distros = _xml.getElementsByTagName("distro") distros = [] for distro in xml_distros: distros.append({ 'name': distro.getElementsByTagName("name")[0].firstChild.nodeValue, 'urls': [x.firstChild.nodeValue for x in distro.getElementsByTagName("url")], 'archs': [x.firstChild.nodeValue for x in distro.getElementsByTagName("arch")], 'versions': [x.firstChild.nodeValue for x in distro.getElementsByTagName("version")], 'methods': [x.firstChild.nodeValue for x in distro.getElementsByTagName("method")], 'sections': [x.firstChild.nodeValue for x in distro.getElementsByTagName("section")], 'media': [x.firstChild.nodeValue for x in distro.getElementsByTagName("media")] }) return distrosdistros = load_config(FILE)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -