Skip to content
Snippets Groups Projects
Commit afaa4933 authored by Tue Herlau's avatar Tue Herlau
Browse files

setup.py

parent 28d41ea2
Branches
No related tags found
No related merge requests found
Showing
with 118 additions and 38 deletions
...@@ -2,7 +2,16 @@ ...@@ -2,7 +2,16 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="5c346737-53d8-4e87-88c5-7be2c8e7baeb" name="Default" comment=""> <list default="true" id="5c346737-53d8-4e87-88c5-7be2c8e7baeb" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/cs101courseware_example/instructions.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cs101courseware_example/Report0/Report0.report" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cs101courseware_example/cs101report1.py" beforeDir="false" afterPath="$PROJECT_DIR$/cs101courseware_example/cs101report1.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cs101courseware_example/cs101report1_grade.py" beforeDir="false" afterPath="$PROJECT_DIR$/cs101courseware_example/cs101report1_grade.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unitgrade/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/unitgrade/__init__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unitgrade/unitgrade.py" beforeDir="false" afterPath="$PROJECT_DIR$/unitgrade/unitgrade.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unitgrade/unitgrade_helpers.py" beforeDir="false" afterPath="$PROJECT_DIR$/unitgrade/unitgrade_helpers.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -54,8 +63,8 @@ ...@@ -54,8 +63,8 @@
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="Python Script" />
<option value="Setup Script" /> <option value="Setup Script" />
<option value="Python Script" />
</list> </list>
</option> </option>
</component> </component>
...@@ -135,8 +144,8 @@ ...@@ -135,8 +144,8 @@
<recent name="C:\Users\tuhe\Documents\unitgrade_private" /> <recent name="C:\Users\tuhe\Documents\unitgrade_private" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Python.deploy_cs101 (1)"> <component name="RunManager" selected="Python.cs101report1 (1)">
<configuration name="cs101report1" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="cs101report1 (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="unitgrade" /> <module name="unitgrade" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -144,12 +153,11 @@ ...@@ -144,12 +153,11 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/cs101courseware" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/cs101courseware_example" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/cs101courseware_example/cs101report1.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/cs101courseware/cs101report1.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -158,7 +166,7 @@ ...@@ -158,7 +166,7 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="cs101report1_grade" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="deploy_cs101 (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="unitgrade" /> <module name="unitgrade" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -166,12 +174,11 @@ ...@@ -166,12 +174,11 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/cs101courseware" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/../unitgrade_private/cs101courseware" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../unitgrade_private/cs101courseware/deploy_cs101.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/cs101courseware/cs101report1_grade.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -180,7 +187,7 @@ ...@@ -180,7 +187,7 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="deploy_cs101 (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="deploy_cs101" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="unitgrade" /> <module name="unitgrade" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -192,7 +199,7 @@ ...@@ -192,7 +199,7 @@
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/../unitgrade_private/cs101courseware/deploy_cs101.py" /> <option name="SCRIPT_NAME" value="C:\Users\tuhe\Documents\unitgrade_private\cs101courseware\deploy_cs101.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -201,7 +208,7 @@ ...@@ -201,7 +208,7 @@
<option name="INPUT_FILE" value="" /> <option name="INPUT_FILE" value="" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="deploy_cs101" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="instructions" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="unitgrade" /> <module name="unitgrade" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
...@@ -209,11 +216,11 @@ ...@@ -209,11 +216,11 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/../unitgrade_private/cs101courseware" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/cs101courseware_example" />
<option name="IS_MODULE_SDK" value="true" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="C:\Users\tuhe\Documents\unitgrade_private\cs101courseware\deploy_cs101.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/cs101courseware_example/instructions.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
...@@ -244,19 +251,19 @@ ...@@ -244,19 +251,19 @@
<method v="2" /> <method v="2" />
</configuration> </configuration>
<list> <list>
<item itemvalue="Python.cs101report1" />
<item itemvalue="Python.cs101report1_grade" />
<item itemvalue="Python.unitgrade" /> <item itemvalue="Python.unitgrade" />
<item itemvalue="Python.deploy_cs101" /> <item itemvalue="Python.deploy_cs101" />
<item itemvalue="Python.deploy_cs101 (1)" /> <item itemvalue="Python.deploy_cs101 (1)" />
<item itemvalue="Python.instructions" />
<item itemvalue="Python.cs101report1 (1)" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Python.cs101report1 (1)" />
<item itemvalue="Python.deploy_cs101 (1)" /> <item itemvalue="Python.deploy_cs101 (1)" />
<item itemvalue="Python.instructions" />
<item itemvalue="Python.deploy_cs101" /> <item itemvalue="Python.deploy_cs101" />
<item itemvalue="Python.unitgrade" /> <item itemvalue="Python.unitgrade" />
<item itemvalue="Python.cs101report1" />
<item itemvalue="Python.cs101report1_grade" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
...@@ -328,14 +335,14 @@ ...@@ -328,14 +335,14 @@
<option name="timeStamp" value="10" /> <option name="timeStamp" value="10" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/../unitgrade_private/cs101courseware/deploy_cs101.py</url> <url>file://$PROJECT_DIR$/unitgrade/unitgrade_helpers.py</url>
<line>6</line> <line>41</line>
<option name="timeStamp" value="12" /> <option name="timeStamp" value="15" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/unitgrade/unitgrade.py</url> <url>file://$PROJECT_DIR$/unitgrade/unitgrade_helpers.py</url>
<line>154</line> <line>40</line>
<option name="timeStamp" value="13" /> <option name="timeStamp" value="16" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
......
...@@ -2,20 +2,47 @@ ...@@ -2,20 +2,47 @@
Easy-to-use, easy-to-build report evaluations in a framework building on pythons unittest classes Easy-to-use, easy-to-build report evaluations in a framework building on pythons unittest classes
- 100% Python; no dependencies on binary blobs - 100% Python
- No configuration or test-files needed to use or develop - No configuration or test-files needed to use or develop
- Easy to use for students: - Easy to use for students:
- Run tests as a single python command - Run tests as a single python command
- See your score immediately - See your score immediately
- Upload your results as a single file on campusnet with no risk of accidential tampering - Upload your results as a single file on campusnet with no risk of accidential tampering
- All tests are simple classes so it will integrates well with debugger and any IDE - All tests are simple classes so it will integrates well with debugger and any IDE
- Easy to use for teacher: New tests can be build in 100% python, with no need to specify expected output
## What it looks like to a student ## Installation
Homework is broken down into **reports**. A report is a collection of questions which are individually scored, and each question may in turn involve multiple tests. Each report is therefore given an overall score based on a weighted average of how many tests are passed. Unitgrade can be installed through pip using
```
pip install git+ssh://git@gitlab.compute.dtu.dk/tuhe/unitgrade.git
```
This will install unitgrade in your site-packages directory. If you are using anaconda+virtual environment you can install it as
```
source activate myenv
conda install git pip
pip install git+ssh://git@gitlab.compute.dtu.dk/tuhe/unitgrade.git
```
Alternatively, simply use git-clone of the sources and add unitgrade to your python path.
In practice, a report consist of an ordinary python file which they simply run. It looks like this: When you are done, you should be able to import unitgrade:
```
import unitgrade
```
## Testing installation
I have provided an example project which illustrates all main features in a self-contained manner and which should
work immediately upon installation. The source can be found here: https://lab.compute.dtu.dk/tuhe/unitgrade/-/tree/master/cs101courseware_example
To run the example, first start a python console:
```
python
```
Then run the code
```
from cs101courseware_example import instructions
```
This will print on-screen instructions for how to use the system tailored to your user-specific installation path.
## Evaluating a report
Homework is broken down into **reports**. A report is a collection of questions which are individually scored, and each question may in turn involve multiple tests. Each report is therefore given an overall score based on a weighted average of how many tests are passed.
In practice, a report consist of an ordinary python file which they simply run. It looks like this (to run this on your local machine, follow the instructions in the previous section):
``` ```
python cs101report1.py python cs101report1.py
``` ```
...@@ -50,9 +77,9 @@ To register your results, please run the file: ...@@ -50,9 +77,9 @@ To register your results, please run the file:
>>> cs101report1_grade.py >>> cs101report1_grade.py
In the same manner as you ran this file. In the same manner as you ran this file.
``` ```
Once students are happy with the result, they run an alternative, not-easy-to-tamper-with script called `cs101report1_grade.py`: Once you are happy with the result, run the alternative, not-easy-to-tamper-with script called `cs101report1_grade.py`:
``` ```
python report1_grade.py python cs101report1_grade.py
``` ```
This runs the same tests, and generates a file `cs101report1.token` which they upload to campusnet. This file contains the results of the report evaluation, the script output, and so on. This runs the same tests, and generates a file `Report0_handin_18_of_18.token`. The file name indicates how many points you got. Upload this file to campusnet.
File deleted
File added
File added
No preview for this file type
No preview for this file type
No preview for this file type
from unitgrade.unitgrade import QuestionGroup, Report, QPrintItem from unitgrade.unitgrade import QuestionGroup, Report, QPrintItem
from unitgrade.unitgrade_helpers import evaluate_report_student from unitgrade.unitgrade_helpers import evaluate_report_student
# from unitgrade.hidden_create_files import setup_answers, setup_grade_file_report from unitgrade_private.hidden_create_files import setup_answers, setup_grade_file_report
class ListReversalQuestion(QuestionGroup): class ListReversalQuestion(QuestionGroup):
title = "Reversal of list" title = "Reversal of list"
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
Note we perform manual and static analysis of the uploaded results. Note we perform manual and static analysis of the uploaded results.
''' '''
import bz2, base64 import bz2, base64
exec(bz2.decompress(base64.b64decode('QlpoOTFBWSZTWW6lBO8ABNJfgERQWv9////nf+/////+YAY99d69edu9XpmV0aHvYA6fDJCMhpU8nqnsknpiPUeqH5CmnkE8U2k09J6gaNDTE9QGiaiYaU/TSZNRhoRp6mgaaAGhoAaDQAANCaaqe9KmaRk9Q0Gg0aAAZNA0AAAAAYSJJ6anoh6p6nqM0CNNAAYjaATAjTQ8p5JkHDQyaaGmRoaZGQZGRoZAYmjJoAyZGIYSKJpoTRkp+UDIniap5kk8pkMjEAGho9TTT1NpNEiSNGpHC/8rES0baAmOXGOl9inix2CBpKdDt9WWqm9CAmkjGDCeZ7lpWDnGuPpaMy9lLtbzO0wJQHWjdQASE1C0YArqrjXhyApmcVIeIybQuZuYbtHkx5i1JUYb4yooIIqlg2K+4JAwNeea6oPqB1HQhiCVaiBBJpNNZexZCUZTlC0HqNKpRs34kYNjQTUHi2o9pig47fiD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GWhy3KrvyAmomdg0wtGTzdnP59TT110IJa7gGmFqJ5KygDlXvIOdUUcDRbvRkDzjNT6zqVGBrqA51S5fJsY0NnEjSYshon44qy8LsQsYpgc2r4xKBgWNrooErJKYAhyFAEv8SROcg5aRbibYccUGxAyAE2J00jNdts3VAWqahcg0zCKqTVrBwGrgh2G7sF9zQg4uWREMwzR+at0Uml7mHAqCNob5pzzaIMUD4QDX12AfE5Ua0CyyqH79pdituRGKy6C7b0QvOd8iO1JAfZsOnDacS4ldZtIiTSZ3MqmRN0TKC7fVmg3J8mSMW28tOKzv4wx45c1S1pICITPKIoihJaeA0bgMrB+NMs1r3hthci9ZInCI+9USCaqQg0RPLp6xNuQLZFiRsYooFVIZDN5mEpfGo7GgWQuZsRGOgkohj0EuTgWWgF42GZIiQSMq7uMfH8agx3GYsqatYEN55o1lRGJ5hkkPqSQEkEIzCGc3MtRmtGr2qDDwiXigqpoIMsg4XFFKYh7FNchSa03C72PO71dXejA22Soiz2oPZ8qncD49ma8Gnuq0hAUE1rbAYq2YhuNIg1vyVaiHDY84CRFMEFph7EkBLcplL/NHWe33eU5fwyfV6XF14/4u5IpwoSDEPsT+A==')))
\ No newline at end of file \ No newline at end of file
import os
import textwrap
def fprint(s):
print("\n".join(textwrap.wrap(s, width=100)))
def tprint(s):
print(f"\n> {s}\n")
if __name__ == "__main__":
s = """
This is an example script to illustrate unitgrade for a very simple, fictitious course. Because this is a build-in
example, the source code will likely reside in your site-packages directory. The full example can be found at:"""
print(s)
wdir = os.path.dirname(__file__)
tprint(wdir)
print("The directory contains the source for a fictitious course. The content of the directory is:")
for d in os.listdir(wdir):
if "__" not in d and d != "instructions.py":
print("> ", d)
print("")
fprint("The file homework1.py is the file you edit as part of the course; you are welcome to open it and inspect the content, but right now it consists of some simple programming tasks plus instructions.")
fprint("The file cs101report1.py contains the actual tests of the program. All the tests are easily readable and the script will work with your debugger if you are using pycharm, however, we will run the script for the command line. ")
fprint("To do so, open a console, and change directory to the cs101 main directory using e.g.:")
tprint(f'cd "{wdir}"')
print("Then run the script as usual")
tprint(f'python cs101report1.py')
from setuptools import setup from setuptools import setup
# from unitgrade import version
# version = "0.0.1"
from unitgrade import __version__ as version
setup( setup(
name='unitgrade', name='unitgrade',
version='0.0.1', version=version,
packages=['unitgrade', 'cs101courseware_example'], packages=['unitgrade', 'cs101courseware_example'],
url='https://lab.compute.dtu.dk/tuhe/unitgrade', url='https://lab.compute.dtu.dk/tuhe/unitgrade',
license='Apache', license='Apache',
......
__version__ = "0.0.1"
import os import os
import compress_pickle import compress_pickle
......
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -152,7 +152,7 @@ class Report(): ...@@ -152,7 +152,7 @@ class Report():
# working_directory = os.path.join(pathlib.Path(__file__).parent.absolute(), "payloads/") # working_directory = os.path.join(pathlib.Path(__file__).parent.absolute(), "payloads/")
self.wdir, self.name = setup_dir_by_class(self, working_directory) self.wdir, self.name = setup_dir_by_class(self, working_directory)
# trace = inspect.trace() # trace = inspect.trace()
self.computed_answers_file = self.wdir + "/" + self.name + ".report" self.computed_answers_file = self.wdir + "/" + self.name + "_resources_do_not_hand_in.dat"
self.questions = [(Q(working_directory=self.wdir),w) for Q,w in self.questions] self.questions = [(Q(working_directory=self.wdir),w) for Q,w in self.questions]
if os.path.isfile(self.computed_answers_file): if os.path.isfile(self.computed_answers_file):
self.set_payload(cache_read(self.computed_answers_file)) self.set_payload(cache_read(self.computed_answers_file))
......
...@@ -27,6 +27,17 @@ def evaluate_report_student(report, question=None, qitem=None): ...@@ -27,6 +27,17 @@ def evaluate_report_student(report, question=None, qitem=None):
def evaluate_report(report, question=None, qitem=None): def evaluate_report(report, question=None, qitem=None):
now = datetime.now() now = datetime.now()
import pyfiglet
ascii_banner = pyfiglet.figlet_format("UnitGrade", font="doom")
# print(ascii_banner)
b = "\n".join( [l for l in ascii_banner.splitlines() if len(l.strip()) > 0] )
import unitgrade
print(b + " v" + unitgrade.__version__)
dt_string = now.strftime("%d/%m/%Y %H:%M:%S") dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
print("Starting on " + dt_string) print("Starting on " + dt_string)
print("Evaluating " + report.title) print("Evaluating " + report.title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment