From fd13b16ba823bcd7b6f9c7163e7e75585855d33f Mon Sep 17 00:00:00 2001 From: jwansek Date: Thu, 28 Apr 2022 20:11:13 +0100 Subject: Updated readme and docs --- Smarker/assessments.py | 5 ++++- Smarker/smarker.py | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Smarker') diff --git a/Smarker/assessments.py b/Smarker/assessments.py index a6c4df8..4f32353 100644 --- a/Smarker/assessments.py +++ b/Smarker/assessments.py @@ -24,7 +24,7 @@ def generate_plagarism_report(codes): input("%s..." % td) print(pycode_similar.detect(os.listdir(td))) -if __name__ == "__main__": +def getparser(): config = configparser.ConfigParser() config.read(os.path.join(os.path.split(__file__)[0], "smarker.conf")) @@ -81,7 +81,10 @@ if __name__ == "__main__": default = config.get("mysql", option), help = "Optional argument inherited from config file. Read smarker.conf for details." ) + return parser +if __name__ == "__main__": + parser = getparser() args = vars(parser.parse_args()) with database.SmarkerDatabase( diff --git a/Smarker/smarker.py b/Smarker/smarker.py index 8b8527e..39c22e6 100644 --- a/Smarker/smarker.py +++ b/Smarker/smarker.py @@ -73,7 +73,7 @@ def main(**kwargs): # input("\n\n[tempdir: %s] Press any key to close..." % tempdir) -if __name__ == "__main__": +def getparser(): config = configparser.ConfigParser() config.read(os.path.join(os.path.split(__file__)[0], "smarker.conf")) @@ -127,6 +127,11 @@ if __name__ == "__main__": except KeyError: pass + return parser + +if __name__ == "__main__": + parser = getparser() + args = vars(parser.parse_args()) main(**args) \ No newline at end of file -- cgit v1.2.3