Example #1
0
    'staff_dir': resolve(milestone.starting_code_path),
    'include': milestone.included_file_patterns.split(),
    'exclude': milestone.excluded_file_patterns.split(),
    'restrict': milestone.restrict_access,
    'generate_comments': milestone.run_checkstyle,
    'suppress_regex': make_regex_list(milestone.suppress_checkstyle_regex),
    'restrict_to_usernames': set([re.sub(':.*$', '', u) for u in args.usernames])
    }
# print settings

starting_time = time.time()

staff_code = {}
if settings['staff_dir'] is not None:
  print "Crawling staff code in", settings['staff_dir']
  staff_code = parse_staff_code(settings['staff_dir'], settings['include'], settings['exclude'])
#print staff_code.keys()

batch = Batch(name=milestone.full_name())
if settings['save_data']:
  batch.save()
  print "Batch ID: %s" % (batch.id)

# Crawling the file system.
student_code = crawl_submissions(settings['student_submission_dir'], settings['include'], settings['exclude'])

code_objects = parse_all_files(student_code, settings['student_submission_dir'], batch, milestone, settings['save_data'], staff_code, settings['restrict'], settings['restrict_to_usernames'])

if parse.failed_users:
  print "To add the missing users to Caesar, use scripts/addMembers.py to add the following list of users:"
  print ','.join(parse.failed_users)
Example #2
0
    'student_submission_dir': stripTrailingSlash(args.submissions)
    }
#print settings

starting_time = time.time()

# TODO(mglidden)
# Placing the entire preprocessor in a transaction might slow down the database during
# load time, but it will automatically roll back the changes if there's an exception.
# with transaction.commit_on_success():

# Finding the submit milestone object
submit_milestone = SubmitMilestone.objects.get(id=settings['submit_milestone_id'])
print "Found existing submit milestone. Adding code to %s." % (submit_milestone.full_name())

staff_code = parse_staff_code(settings['staff_dir']) if settings['staff_dir'] is not None else {}
#print staff_code.keys()

batch = Batch(name=submit_milestone.full_name())
if settings['save_data']:
  batch.save()
  print "Batch ID: %s" % (batch.id)

# Crawling the file system.
student_code = crawl_submissions(settings['student_submission_dir'])

code_objects = parse_all_files(student_code, settings['student_submission_dir'], batch, submit_milestone, settings['save_data'], staff_code, args.restrict)

if parse.failed_users:
  print "To add the missing users to Caesar, use scripts/addMembers.py to add the following list of users:"
  print ','.join(parse.failed_users)
Example #3
0
#print settings

starting_time = time.time()

# TODO(mglidden)
# Placing the entire preprocessor in a transaction might slow down the database during
# load time, but it will automatically roll back the changes if there's an exception.
# with transaction.commit_on_success():

# Finding the submit milestone object
submit_milestone = SubmitMilestone.objects.get(
    id=settings['submit_milestone_id'])
print "Found existing submit milestone. Adding code to %s." % (
    submit_milestone.full_name())

staff_code = parse_staff_code(
    settings['staff_dir']) if settings['staff_dir'] is not None else {}
#print staff_code.keys()

batch = Batch(name=submit_milestone.full_name())
if settings['save_data']:
    batch.save()
    print "Batch ID: %s" % (batch.id)

# Crawling the file system.
student_code = crawl_submissions(settings['student_submission_dir'])

code_objects = parse_all_files(student_code,
                               settings['student_submission_dir'], batch,
                               submit_milestone, settings['save_data'],
                               staff_code, args.restrict)
Example #4
0
    'include': milestone.included_file_patterns.split(),
    'exclude': milestone.excluded_file_patterns.split(),
    'restrict': milestone.restrict_access,
    'generate_comments': milestone.run_checkstyle,
    'suppress_regex': make_regex_list(milestone.suppress_checkstyle_regex),
    'restrict_to_usernames':
    set([re.sub(':.*$', '', u) for u in args.usernames])
}
# print settings

starting_time = time.time()

staff_code = {}
if settings['staff_dir'] is not None:
    print "Crawling staff code in", settings['staff_dir']
    staff_code = parse_staff_code(settings['staff_dir'], settings['include'],
                                  settings['exclude'])
#print staff_code.keys()

batch = Batch(name=milestone.full_name())
if settings['save_data']:
    batch.save()
    print "Batch ID: %s" % (batch.id)

# Crawling the file system.
student_code = crawl_submissions(settings['student_submission_dir'],
                                 settings['include'], settings['exclude'])

code_objects = parse_all_files(student_code,
                               settings['student_submission_dir'], batch,
                               milestone, settings['save_data'], staff_code,
                               settings['restrict'],