@task
@cmdopts([BOKCHOY_IMPORTS_DIR, BOKCHOY_IMPORTS_DIR_DEPR, PA11Y_FETCH_COURSE])
@timed
def get_test_course(options):
 if options.get('imports_dir'):
  print colorize('green', '--imports-dir specified, skipping fetch of test course')
  return
 if (not options.get('should_fetch_course', False)):
  print colorize('green', '--skip-fetch specified, skipping fetch of test course')
  return
 options.imports_dir = DEMO_COURSE_IMPORT_DIR
 options.imports_dir.makedirs_p()
 zipped_course = (options.imports_dir + 'demo_course.tar.gz')
 msg = colorize('green', 'Fetching the test course from github...')
 print msg
 sh('wget {tar_gz_file} -O {zipped_course}'.format(tar_gz_file=DEMO_COURSE_TAR_GZ, zipped_course=zipped_course))
 msg = colorize('green', 'Uncompressing the test course...')
 print msg
 sh('tar zxf {zipped_course} -C {courses_dir}'.format(zipped_course=zipped_course, courses_dir=options.imports_dir))

@ task @ cmdopts ( [ BOKCHOY_IMPORTS_DIR , BOKCHOY_IMPORTS_DIR_DEPR , PA11Y_FETCH_COURSE ] ) @ timed def get_test_course ( options ) : if options . get ( 'imports_dir' ) : print colorize ( 'green' , '--imports-dir specified, skipping fetch of test course' ) return if ( not options . get ( 'should_fetch_course' , False ) ) : print colorize ( 'green' , '--skip-fetch specified, skipping fetch of test course' ) return options . imports_dir = DEMO_COURSE_IMPORT_DIR options . imports_dir . makedirs_p ( ) zipped_course = ( options . imports_dir + 'demo_course.tar.gz' ) msg = colorize ( 'green' , 'Fetching the test course from github...' ) print msg sh ( 'wget {tar_gz_file} -O {zipped_course}' . format ( tar_gz_file = DEMO_COURSE_TAR_GZ , zipped_course = zipped_course ) ) msg = colorize ( 'green' , 'Uncompressing the test course...' ) print msg sh ( 'tar zxf {zipped_course} -C {courses_dir}' . format ( zipped_course = zipped_course , courses_dir = options . imports_dir ) )
fetches the test course .