def setUp(self): self.cfg = settings.readConfig('topo.cfg') self.host1 = telnet_con.TelNode(self.cfg['host1']['con_ip'], self.cfg['host1']['con_port']) self.host2 = telnet_con.TelNode(self.cfg['host2']['con_ip'], self.cfg['host2']['con_port']) self.user = "******" self.password = "******"
def setUp(self): print("start testing") self.cfg = settings.readConfig('topo.cfg') self.ovs1 = telnet_con.TelNode( self.cfg['ovs1']['con_ip'], self.cfg['ovs1']['con_port']) self.ovs2 = telnet_con.TelNode( self.cfg['ovs2']['con_ip'], self.cfg['ovs2']['con_port']) self.ovs3 = telnet_con.TelNode( self.cfg['ovs3']['con_ip'], self.cfg['ovs3']['con_port']) self.user = "******" self.password = "******"
def setUp(self): self.cfg = settings.readConfig('topo.cfg') self.django_server = telnet_con.TelNode( self.cfg['django_server']['con_ip'], self.cfg['django_server']['con_port']) self.wp_server = telnet_con.TelNode(self.cfg['wp_server']['con_ip'], self.cfg['wp_server']['con_port']) self.wp_db = telnet_con.TelNode(self.cfg['wp_db']['con_ip'], self.cfg['wp_db']['con_port']) self.build_server = telnet_con.TelNode( self.cfg['build_server']['con_ip'], self.cfg['build_server']['con_port']) self.django_db = telnet_con.TelNode(self.cfg['django_db']['con_ip'], self.cfg['django_db']['con_port']) self.user = "******" self.password = "******"
def main(): parser = argparse.ArgumentParser( description="""WikiPride analytics framework. """) parser.add_argument('-c', '--config', metavar="", type=str, default=None, help='<path> to the config file') parser.add_argument( '-l', '--language', metavar='', type=str, help='the language of the wiki project to analyze', ) parser.add_argument( '-d', '--droptables', action='store_true', dest='droptables', default=False, help='if True, all SQL tables will be dropped before being created', ) parser.add_argument( 'workstep', type=str, choices=['all', 'preprocessing', 'data', 'report'], help= """the part of the workflow to be executed. all: preprocessing, data and report. preprocessing: aggregate mediawiki SQL tables into analytic-friendly auxialiary tables. data: compute the cohort analysis data (prerequisite: preprocessing workstep) report: create a set of standard reports (prerequisite: data workstep).""") args = parser.parse_args() # read config passed as argument if os.path.isfile(args.config): settings.readConfig(args.config) else: logger.warning('Invalid config file: %s' % args.config) return settings.droptables = args.droptables if args.workstep == 'all': from data import preprocessing from data import report preprocessing.process() report.processData() report.processReport() elif args.workstep == 'preprocessing': from data import preprocessing preprocessing.process() elif args.workstep == 'data': from data import report report.processData() elif args.workstep == 'report': from data import report report.processReport()
def setUp(self): self.cfg = settings.readConfig('topo.cfg') self.router = telrouter.TelNode( self.cfg['router']['con_ip'], self.cfg['router']['con_port'])
def __init__(self, user, passwd): self.user = user self.password = passwd self.cfg = settings.readConfig('topo.cfg')
def main(): parser = argparse.ArgumentParser( description="""WikiPride analytics framework. """ ) parser.add_argument( '-c', '--config', metavar="", type=str, default=None, help='<path> to the config file' ) parser.add_argument( '-l', '--language', metavar='', type=str, help='the language of the wiki project to analyze', ) parser.add_argument( '-d', '--droptables', action='store_true', dest='droptables', default=False, help='if True, all SQL tables will be dropped before being created', ) parser.add_argument( 'workstep', type=str, choices=['all','preprocessing','data','report'], help="""the part of the workflow to be executed. all: preprocessing, data and report. preprocessing: aggregate mediawiki SQL tables into analytic-friendly auxialiary tables. data: compute the cohort analysis data (prerequisite: preprocessing workstep) report: create a set of standard reports (prerequisite: data workstep).""" ) args = parser.parse_args() # read config passed as argument if os.path.isfile(args.config): settings.readConfig(args.config) else: logger.warning('Invalid config file: %s'%args.config) return settings.droptables = args.droptables if args.workstep == 'all': from data import preprocessing from data import report preprocessing.process() report.processData() report.processReport() elif args.workstep == 'preprocessing': from data import preprocessing preprocessing.process() elif args.workstep == 'data': from data import report report.processData() elif args.workstep == 'report': from data import report report.processReport()