Пример #1
0
	def __init__(self):
		" Automatically retrieve the information about the configuration in configuration.xml"
		MyXmlParser.__init__(self,"configuration.xml")
		self.time = 0
		self.default_client = ""
		self.client_command = ""
		self.last_feed = ""
		self.read_conf()
		self.__check_configuration()
Пример #2
0
 def __init__(self):
     " Automatically retrieve the information about the configuration in configuration.xml"
     MyXmlParser.__init__(self, "configuration.xml")
     self.time = 0
     self.default_client = ""
     self.client_command = ""
     self.last_feed = ""
     self.read_conf()
     self.__check_configuration()
Пример #3
0
def read_clients():
	""" Retrieve from clients.xml file the list of the supported clients """

	parser = MyXmlParser('clients.xml')
	
	n_clients = parser.number_entries('client')
	# return a list of entry like {name:'value',command:'value'}
	entries = parser.get_list(n_clients,['name','command'],['\n','\t'])
	clients = {}
	for client in entries:
		clients[str(client['name'])] = str(client['command'])
		
	return clients
Пример #4
0
def read_clients():
    """ Retrieve from clients.xml file the list of the supported clients """

    parser = MyXmlParser('clients.xml')

    n_clients = parser.number_entries('client')
    # return a list of entry like {name:'value',command:'value'}
    entries = parser.get_list(n_clients, ['name', 'command'], ['\n', '\t'])
    clients = {}
    for client in entries:
        clients[str(client['name'])] = str(client['command'])

    return clients
Пример #5
0
def catalogo():
	""" 
	     retrieve all tv-series from telefilm.xml   
	     should build a list of telefilm catalog[<name-serie>].parameters (like quality)
	"""

	parser = MyXmlParser('telefilm.xml')
	
	n_series = parser.number_entries('serie')
	# return a list of entry like {title:'value',quality:'value'}
	entries = parser.get_list(n_series,['title','quality'],['\n','\t'])
	catalog = []
	for serie in entries:
		key = ((serie['title']+serie['quality']).replace(' ','')).lower()
		catalog.append(key)
	

	return catalog