コード例 #1
0
ファイル: preprocessor.py プロジェクト: uid/caesar-web
# 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)
  print "Then reload their submissions."

print "Found %s submissions." % (len(code_objects))

if settings['generate_comments']:
  print "Generating checkstyle comments..."
  generate_checkstyle_comments(code_objects, settings['save_data'], batch, settings['suppress_regex'])
コード例 #2
0
ファイル: preprocessor.py プロジェクト: khobbs91/caesar-web
# 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)
  print "Then reload their submissions."

print "Found %s submissions." % (len(code_objects))

if settings['generate_comments']:
  print "Generating checkstyle comments..."
  generate_checkstyle_comments(code_objects, settings['save_data'], batch)
コード例 #3
0
ファイル: preprocessor.py プロジェクト: khanhnnvn/caesar-web
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)
    print "Then reload their submissions."

print "Found %s submissions." % (len(code_objects))

if settings['generate_comments']:
    print "Generating checkstyle comments..."
    generate_checkstyle_comments(code_objects, settings['save_data'], batch)
コード例 #4
0
ファイル: preprocessor.py プロジェクト: gienyshy/caesar-web
    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)
    print "Then reload their submissions."

print "Found %s submissions." % (len(code_objects))

if settings['generate_comments']:
    print "Generating checkstyle comments..."
    generate_checkstyle_comments(code_objects, settings['save_data'], batch,
                                 settings['suppress_regex'])