def descargar_dblp(self): global FIN_DESCARGA URL = "http://dblp.uni-trier.de/xml/dblp.xml" URLInteract.descargar_fichero(URL) FIN_DESCARGA = 1 return 1
parser.add_argument('-I', dest='interfaz_activa',action='store_const',const=1,default=0,help='Especifica si se quiere ejecutar con interfaz.') parser.add_argument('-D', dest='descarga_activa',action='store_const',const=1,default=0,help='Especifica si se quieren descargar los datos.') parser.add_argument('-P', dest='procesar_activa',action='store_const',const=1,default=0,help='Especifica si se quieren procesar los datos.') parser.add_argument('-F', dest='fusionar_activa',action='store_const',const=1,default=0,help='Especifica si se quieren fusionar ficheros.') parser.add_argument('-S', dest='busqueda_activa',action='store_const',const=1,default=0,help='Especifica si se quiere buscar pdfs para dichos titulos.') args = parser.parse_args() if args.interfaz_activa == 1: Interfaz_Usuario() elif args.descarga_activa == 1: # Descargamos los datos si es que es necesario URL = "http://dblp.uni-trier.de/xml/dblp.xml" URLInteract.descargar_fichero(URL) # Comprobamos si se quieren procesar y lo hacemos if args.procesar_activa == 1: if args.origen_datos == "dblp": indices = XML_PDFParser.buscar_fichero("dblp.xml",args.termino_busqueda,"") etiquetas_apertura = ["<article","<incollection","<proceedings","<phdthesis","<mastersthesis","<book","<www","<inproceedings"] etiquetas_cierre = ["</article>","</incollection>","</proceedings>","</phdthesis>","</mastersthesis>","</book>","</www>","</inproceedings>"] print indices XML_PDFParser.obten_grupo_xml_multiple("dblp.xml",args.fichero_destino+"_temp.txt",indices,etiquetas_apertura,etiquetas_cierre)