From d262c125550dfb952abeb1c953731f470c52decd Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 15 Nov 2021 19:46:31 +0000 Subject: made a start on analysis --- reportWriter.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'reportWriter.py') diff --git a/reportWriter.py b/reportWriter.py index e69de29..ebbfecf 100644 --- a/reportWriter.py +++ b/reportWriter.py @@ -0,0 +1,36 @@ +from dataclasses import dataclass +import datetime + +@dataclass +class MarkDownReportWriter: + student_no:str + + def __post_init__(self): + self.__push_line(""" +# %s Submission Report + +Report automatically generated at %s + +## Files\n\n""" % (self.student_no, datetime.datetime.now())) + + def __push_line(self, line): + with open("%s_report.md" % self.student_no, "a") as f: + f.write(line) + + def append_module(self, module_name, found = True, docs = None): + self.__push_line("### File: `%s.py`\n\n" % module_name) + if found: + self.__push_line(" - [x] Present\n") + if len(docs) > 2: + self.__push_line(" - [x] Documented (%d characters)\n\n" % (len(docs))) + else: + self.__push_line(" - [ ] Present\n\n") + + def append_class(self, class_name, found = True, docs = None): + self.__push_line("#### Class: `%s`\n\n" % class_name) + if found: + self.__push_line(" - [x] Present\n") + if len(docs) > 2: + self.__push_line(" - [x] Documented (%d characters)\n\n" % (len(docs))) + else: + self.__push_line(" - [ ] Present\n\n") \ No newline at end of file -- cgit v1.2.3