Example #1
0
def main():
    basic_config()
    application = webapp.WSGIApplication(path_list)
    run_wsgi_app(application)
Example #2
0
        max_size = random.choice(sizes)
        min_size = int(max_size * 0.5)
        # min_size = 1
        size_str = "(%d/%d)" % (min_size, max_size)
        try:
            text = speaker.speak(min_size, max_size)
            print "+ %s [%d] %s" % (size_str, len(text), text)
            successes += 1
        except Exception, e:
            print "! %s %s: %s" % (size_str, e.__class__.__name__, e)
            if options.verbose:
                traceback.print_exc()
        
    print "%d/%d successes (%.1f%%)" % (successes, speak_count, float(successes)/speak_count * 100)
    

op = OptionParser()
op.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true", help="verbose logging")

options, args = op.parse_args()
basic_config()
if not options.verbose:
    logging.getLogger().setLevel(logging.INFO)    

if len(args) != 2:
    sys.stderr.write('ERROR - expected <speaker> [count] (%s)\n' % speaker_list_string())
    sys.exit(1)

name, count = args

run(name, int(count), options)
Example #3
0
def main():
    basic_config()
    util.run_wsgi_app(application)