Beispiel #1
0
 def init_dest(self):
     self.course_path = os.path.join(self.exchange_directory, self.course_id)
     self.inbound_path = os.path.join(self.course_path, 'inbound')
     self.assignment_filename = get_username() + '+' + self.assignment_id + '+' + self.timestamp
     self.dest_path = os.path.join(self.inbound_path, self.assignment_filename)
     if not os.path.isdir(self.inbound_path):
         self.fail("Inbound directory doesn't exist: {}".format(self.inbound_path))
     if not check_mode(self.inbound_path, write=True, execute=True):
         self.fail("You don't have write permissions to the directory: {}".format(self.inbound_path))
Beispiel #2
0
    def init_dest(self):
        if self.course_id == '':
            self.fail("No course id specified. Re-run with --course flag.")

        self.inbound_path = os.path.join(self.exchange_directory, self.course_id, 'inbound')
        if not os.path.isdir(self.inbound_path):
            self.fail("Inbound directory doesn't exist: {}".format(self.inbound_path))
        if not check_mode(self.inbound_path, write=True, execute=True):
            self.fail("You don't have write permissions to the directory: {}".format(self.inbound_path))

        self.cache_path = os.path.join(self.cache_directory, self.course_id)
        self.assignment_filename = '{}+{}+{}'.format(get_username(), self.assignment_id, self.timestamp)
from nbgrader.utils import get_username

c = get_config()

c.NbGrader.course_id = "demo"
c.NbGrader.db_assignments = [dict(name="ps1")]
c.NbGrader.db_students = [dict(id=get_username())]