コード例 #1
0
def main(argv):
	monthid = 0 
	single = 0;

	try:
		opts, args = getopt.getopt(argv, "lhm:s:", ['month','list', 'single'])
	except getopt.GetoptError:
		print 'SpeedyPlus.py -m <monthId> [-s <siteid>]'
		sys.exit(2)
		
	for opt, arg in opts:
		if opt == '-h':
			print 'SpeedyPlus.py -m <monthId>'
			sys.exit()
		elif opt in ('-m', '--month'):
			monthid = arg 
		elif opt in ('-l', '--list'):
			s = SpeedyDb()
			s.listMonths()
			sys.exit()
		elif opt in ('-s', '--single'):
			single = arg 
			
	
	print 'MonthId [', monthid , ']'
	
	if monthid != 0:

		s = SpeedyDb()

		if single != 0:
			#process just one site. (ignore valid month thing)			
			ps = PageSpeedy()
			ps.ProcessSingleSite(single, monthid)
			
			wp = wapple.SpeedyWapple()
			wp.ProcessSingleSite(single, monthid)
			
			#ch = checker.AChecker()
			#ch.ProcessSingleSite(single, monthid)
			
			sys.exit()			
		elif s.validMonth(monthid) == 1 :
			s.backup(monthid)	
		
		# pagespeed check
		#	ps = PageSpeedy()
		#	ps.runSpeedy(monthid)
			
		# wapplizer check
			wp = SpeedyWapple()
			wp.process(monthid)

		# peeky (extra looking)			
			pky = Peeky()
			pky.goPeek(monthid)
			pky.close()

		# screengrabs
			grab = ScreenGrabby()
			grab.runGrabby(monthid)
			
		# accessilbity check
		#	ch = checker.AChecker()
		#	ch.runChecker(monthid)
			
			s.closeMonth(monthid)
		else:
			print 'not a valid month'
コード例 #2
0
def main(argv):
    monthid = 0
    single = 0

    try:
        opts, args = getopt.getopt(argv, "lhmn:s:", ["month", "list", "single", "now"])

    except getopt.GetoptError:
        print "SpeedyPlus.py -m <monthId> [-s <siteid>]"
        sys.exit(2)

    for opt, arg in opts:
        if opt == "-h":
            print "SpeedyPlus.py -m <monthId>"
            sys.exit()

        elif opt in ("-m", "--month"):
            monthid = arg

        elif opt in ("-l", "--list"):
            s = SpeedyDb()
            s.listMonths()
            sys.exit()

        elif opt in ("-s", "--single"):
            single = arg

        elif opt in ("-n", "--now"):
            monthid = getMonth()

    print "MonthId [", monthid, "]"

    if monthid != 0:

        s = SpeedyDb()

        if single != 0:
            # process just one site. (ignore valid month thing)
            ps = PageSpeedy()
            ps.ProcessSingleSite(single, monthid)

            # wp = wapple.SpeedyWapple()
            # wp.ProcessSingleSite(single, monthid)

            # ch = checker.AChecker()
            # ch.ProcessSingleSite(single, monthid)

            sys.exit()
        elif s.validMonth(monthid) == 1:
            s.backup(monthid)

            # pagespeed check
            ps = PageSpeedy()
            ps.runSpeedy(monthid)

            # wapplizer check
            # 	wp = SpeedyWapple()
            # 	wp.process(monthid)

            # peeky (extra looking)
            # 	pky = Peeky()
            # 	pky.goPeek(monthid)
            # 	pky.close();

            # screengrabs
            # 	grab = ScreenGrabby()
            # 	grab.runGrabby(monthid)

            # accessilbity check
            # 	ch = checker.AChecker()
            # 	ch.runChecker(monthid)

            s.closeMonth(monthid)
        else:
            print "not a valid month"