1#!/usr/bin/env python 2 3import argparse 4import sys 5 6argparser = argparse.ArgumentParser( 7 description="Take a screenshot!", 8 epilog="I can output PNG, JPEG, GIF, and other PIL-supported formats.") 9argparser.add_argument("-c", "--crtc", type=int, default=0, 10 help="CRTC id (default first screen)") 11argparser.add_argument("path", help="output image location") 12 13args = argparser.parse_args() 14 15# Do some evil. 16sys.path.insert(0, "/usr/local/autotest") 17 18# This import can't be moved to before the sys.path alteration. 19from cros.graphics.drm import crtcScreenshot 20 21image = crtcScreenshot(args.crtc) 22image.save(args.path) 23