本文整理汇总了Python中group.Group.submission_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Group.submission_directory方法的具体用法?Python Group.submission_directory怎么用?Python Group.submission_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类group.Group
的用法示例。
在下文中一共展示了Group.submission_directory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getattr
# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import submission_directory [as 别名]
import argparse
import re
from group import Group
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)
console_handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
logger.addHandler(console_handler)
parser = argparse.ArgumentParser(description = "Group prac runner")
parser.add_argument('-d')
parser.add_argument('-p')
args = parser.parse_args()
tester_module = importlib.import_module("prac{n}_tests".format(n = args.p))
TesterClass = getattr(tester_module, "Prac{n}Tests".format(n = args.p))
student_numbers = ""
for match in re.finditer("[a-z]{6}[0-9]{3}", args.d.lower()):
student_numbers += match.group(0) + '_'
student_numbers = student_numbers[0:-2]
submitter = Group(members = student_numbers, group_id=student_numbers, logger = logger.getChild('manual_marker'))
submitter.directory = args.d
submitter.submission_directory = args.d
tester = TesterClass(submitter, logger.getChild('prac{n}'.format(n = args.p)))
tester.catalogue_submission_files()
tester.build()
tester.run_tests()