top_authors = {} top_authors['authors.'] = Mediawiki.GetTopAuthorsMediaWiki( 0, startdate, enddate, identities_db, bots, npeople) top_authors['authors.last year'] = Mediawiki.GetTopAuthorsMediaWiki( 365, startdate, enddate, identities_db, bots, npeople) top_authors['authors.last month'] = Mediawiki.GetTopAuthorsMediaWiki( 31, startdate, enddate, identities_db, bots, npeople) createJSON(top_authors, destdir + "/mediawiki-top.json") return (top_authors) if __name__ == '__main__': logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s') logging.info("Starting Mediawiki data source analysis") opts = read_options() period = getPeriod(opts.granularity) reports = opts.reports.split(",") # filtered bots bots = ['wikibugs', 'gerrit-wm', 'wikibugs_', 'wm-bot', ''] # TODO: hack because VizR library needs. Fix in lib in future startdate = "'" + opts.startdate + "'" enddate = "'" + opts.enddate + "'" # Working at the same time with VizR and VizPy yet # vizr.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword) GrimoireSQL.SetDBChannel(database=opts.dbname, user=opts.dbuser, password=opts.dbpassword)
top_files_modified_data = SCM.top_files_modified() return top_authors_data def microStudies(enddate, destdir): # Studies implemented in R # Demographics vizr.ReportDemographicsAgingSCM(enddate, destdir) vizr.ReportDemographicsBirthSCM(enddate, destdir) if __name__ == '__main__': logging.basicConfig(level=logging.INFO,format='%(asctime)s %(message)s') logging.info("Starting SCM data source analysis") opts = read_options() period = getPeriod(opts.granularity) nperiod = getPeriod(opts.granularity, True) reports = opts.reports.split(",") # filtered bots bots = ["-Bot", "-Individual", "-Unknown"] # TODO: hack because VizR library needs. Fix in lib in future startdate = "'"+opts.startdate+"'" enddate = "'"+opts.enddate+"'" # Working at the same time with VizR and VizPy yet vizr.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword) GrimoireSQL.SetDBChannel (database=opts.dbname, user=opts.dbuser, password=opts.dbpassword) aggData(period, startdate, enddate, opts.identities_db, opts.destdir)