import pgp_mime as _pgp_mime
+import pygrader as _pygrader
from pygrader import __version__
-from pygrader import ENCODING as _ENCODING
from pygrader import LOG as _LOG
from pygrader import color as _color
from pygrader.email import test_smtp as _test_smtp
_pgp_mime.LOG.addHandler(syslog)
_color.USE_COLOR = args.color
- _ENCODING = args.encoding
+ _pygrader.ENCODING = args.encoding
config = _configparser.ConfigParser()
config.read([
_os_path.expanduser(_os_path.join('~', '.config', 'smtplib.conf')),
- ], encoding=_ENCODING)
+ ], encoding=_pygrader.ENCODING)
func_args = _inspect.getargspec(args.func).args
kwargs = {}
import sys as _sys
import time as _time
+import pygrader as _pygrader
from . import LOG as _LOG
-from . import ENCODING as _ENCODING
from .model.assignment import Assignment as _Assignment
from .model.course import Course as _Course
from .model.grade import Grade as _Grade
"""
_LOG.debug('loading course from {}'.format(basedir))
config = _configparser.ConfigParser()
- config.read([_os_path.join(basedir, 'course.conf')], encoding=_ENCODING)
+ config.read([_os_path.join(basedir, 'course.conf')],
+ encoding=_pygrader.ENCODING)
name = config.get('course', 'name')
names = {'robot': [config.get('course', 'robot').strip()]}
for option in ['assignments', 'professors', 'assistants', 'students']:
_LOG.debug('loading {} grade for {}'.format(assignment, person))
path = assignment_path(basedir, assignment, person)
gpath = _os_path.join(path, 'grade')
- g = parse_grade(_io.open(gpath, 'r', encoding=_ENCODING),
- assignment, person)
+ g = parse_grade(_io.open(gpath, 'r', encoding=_pygrader.ENCODING),
+ assignment, person)
#g.late = _os.stat(gpath).st_mtime > assignment.due
g.late = _os_path.exists(_os_path.join(path, 'late'))
npath = _os_path.join(path, 'notified')
if not _os_path.isdir(path):
_os.makedirs(path)
gpath = _os_path.join(path, 'grade')
- with _io.open(gpath, 'w', encoding=_ENCODING) as f:
+ with _io.open(gpath, 'w', encoding=_pygrader.ENCODING) as f:
f.write('{}\n'.format(grade.points))
if grade.comment:
f.write('\n{}\n'.format(grade.comment.strip()))