summaryrefslogtreecommitdiffstats
path: root/reportWriter.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-11-15 19:46:31 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2021-11-15 19:46:31 +0000
commitd262c125550dfb952abeb1c953731f470c52decd (patch)
tree9b46fae13dbf589f8a7165ccb133794c97d049cf /reportWriter.py
parent4a0b15e2aba519d184f36f330a7b4af05bc2fd7d (diff)
downloadSmarker-d262c125550dfb952abeb1c953731f470c52decd.tar.gz
Smarker-d262c125550dfb952abeb1c953731f470c52decd.zip
made a start on analysis
Diffstat (limited to 'reportWriter.py')
-rw-r--r--reportWriter.py36
1 files changed, 36 insertions, 0 deletions
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