示例#1
0
def test():
    #Take config form file
    conf=q.qA_conf()
    
    #Lista de idiomas que queremos analizar
    #ListaIdiomas=conf.langs
    #ListaIdiomas=["ruwiki","svwiki"]
    ListaIdiomas=["enwiki"]
    
    print "STARTING DATABASE DUMP DECOMPRESSION...\n"
    for idioma in ListaIdiomas:
        dump=dbdump.dump(language=idioma,msqlu=conf.msqlu, msqlp=conf.msqlp)
        #dump.download()
        dump.decompress()
    print "DATABASE DUMP DECOMPRESSION FINISHED...\n"
    
##    print "INITIATING DATABASE ANALYSIS...\n"
##        
##    for idioma in ListaIdiomas:
##        print "ANALYSIS FOR LANGUAGE VERSION " + idioma + "\n\n"
##        dbanaly=dbanaly.dbanaly(conf,idioma)
##        print "AUTHOR ANALYSIS SET UP FOR LANGUAGE VERSION " + idioma + "\n\n"
##        dbanaly.infoAuthors()
##        print "AUTHOR ANALYSIS SET UP COMPLETED FOR LANGUAGE VERSION " + idioma + "\n\n"
##        print "ARTICLE ANALYSIS SET UP FOR LANGUAGE VERSION " + idioma + "\n\n"
##        dbanaly.infoPages()
##        print "ARTICLE ANALYSIS SET UP COMPLETED FOR LANGUAGE VERSION " + idioma + "\n\n"
##        print "INITIATING CONTENTS ANALYSIS FOR LANGUAGE VERSION " + idioma + "\n\n"
##        #dbanaly.infoContents()
##        print "CONTENTS ANALYSIS COMPLETED FOR LANGUAGE VERSION " + idioma + "\n\n"
##        #dbanaly.generalStatistics()
##        print "GENERAL STATISTICS COMPLETED FOR LANGUAGE VERSION " + idioma + "\n\n"
##        
##    print "GENERATING GRAPHICS AND STATISTICAL RESULTS FOR LANGUAGE VERSION " + idioma + "\n\n"
##    graphics.work(ListaIdiomas)
##    print "GRAPHICS AND STATISTICAL RESULTS GENERATED FOR LANGUAGE VERSION " + idioma + "\n\n"
##        
##    print "DATABASE ANALYSIS COMPLETED...\n"
    print "END OF SCRIPT EXECUTION. GOOD LUCK WITH RESULTS INTERPRETATION.\n"
示例#2
0
# coding=utf8
#############################################
#      WikiXRay: Quantitative Analysis of Wikipedia language versions
#############################################
#                  http://wikixray.berlios.de
#############################################
# Copyright (c) 2006-7 Universidad Rey Juan Carlos (Madrid, Spain)
#############################################
# 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; either version 2 or later of the GPL.
#############################################
# Author: Jose Felipe Ortega Soto
"""
Some tests for the dbanaly.py module

@see: quantAnalay_main

@authors: Jose Felipe Ortega
@organization: Grupo de Sistemas y Comunicaciones, Universidad Rey Juan Carlos
@copyright:    Universidad Rey Juan Carlos (Madrid, Spain)
@license:      GNU GPL version 2 or any later version
@contact:      [email protected]
"""
import dbanaly
import qA_conf as q

conf = q.qA_conf()
#Prueba de la herramienta de informacion sobre revisores
dbanaly.test_funciones(conf)
示例#3
0
            else:
                print "Error decompressing "+self.filename
                return -1
        print "Generating indexes for tables page and revision...\n"
        print "Depending on the dump size this may take a while...\n"
        acceso = dbaccess.get_Connection("localhost", 3306, self.msqlu,\
        self.msqlp, "wx_"+self.language+"_"+self.dumptype)
        #Generate adequate indexes and keys in tables page and revision
        print "Generating index for page_len...\n"
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE page ADD INDEX (page_len)")
        print "Modifying rev_timestamp to support DATETIME and creating index...\n"
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE revision MODIFY rev_timestamp DATETIME")
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE revision ADD INDEX timestamp (rev_timestamp)")
        print "Generating index for rev_page and rev_timestamp...\n"
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE revision ADD INDEX page_timestamp(rev_page, rev_timestamp)")
        print "Generating index for rev_user and rev_timestamp...\n"
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE revision ADD INDEX user_timestamp(rev_user, rev_timestamp)")
        print "Generating index for rev_user_text and timestamp...\n"
        dbaccess.raw_query_SQL(acceso[1],"ALTER TABLE revision ADD INDEX usertext_timestamp(rev_user_text(15), rev_timestamp)")
        dbaccess.close_Connection(acceso[0])
        print "Database ready for quantitative analysis...\n"
        print "Let's go on... Cross your fingers... ;-) \n\n\n"
        return success

if __name__ == '__main__':
    conf=q.qA_conf()
    foobar=dump(dumptype="research",msqlu=conf.msqlu, msqlp=conf.msqlp)
    foobar.download()
    foobar.decompress()