def runPreprocess(self, job): success = True # for each preprocessor for pre in job.preprocessors: # print the name io.printIndented("running preprocessor '{}'...".format(pre.name), 1) # if we are a reference, get what we are referencing to jobName = job.name if pre.isReference: jobName = pre.job pre = getPreprocessorReference(self.config, pre.job, pre.name) # see if it has already ran if self.shouldPreprocess(jobName, pre.name, pre.runThisRound): # we need to run, first gather arguments students = self.corpus.students assignments = getJobFromConfig(self.config, jobName).assignments args = pre.args helpers = self.corpus # try to import the correct module try: module = importlib.import_module('preprocessors.' + pre.name) # run it print "" success = module.run(students, assignments, args, helpers) # update progress self.progress.updatePreprogress(job.name, pre.name, success) pre.runThisRound = success except: printError( "module '{}' not found or encountered an error.\n". format(pre.name)) success = False if success: io.printIndented('complete!\n', 1) else: # fail out break else: # don't need to run io.printRaw(' already done!\n') # return true iff all were sucessful return success
def runPreprocess(self, job): success = True # for each preprocessor for pre in job.preprocessors: # print the name io.printIndented("running preprocessor '{}'...".format(pre.name), 1) # if we are a reference, get what we are referencing to jobName = job.name if pre.isReference: jobName = pre.job pre = getPreprocessorReference(self.config, pre.job, pre.name) # see if it has already ran if self.shouldPreprocess(jobName, pre.name, pre.runThisRound): # we need to run, first gather arguments students = self.corpus.students assignments = getJobFromConfig(self.config, jobName).assignments args = pre.args helpers = self.corpus # try to import the correct module try: module = importlib.import_module('preprocessors.' + pre.name) # run it print "" success = module.run(students, assignments, args, helpers) # update progress self.progress.updatePreprogress(job.name, pre.name, success) pre.runThisRound = success except: printError("module '{}' not found or encountered an error.\n".format(pre.name)) success = False if success: io.printIndented('complete!\n', 1) else: # fail out break else: # don't need to run io.printRaw(' already done!\n') # return true iff all were sucessful return success
def runPostprocess(self, job): success = True # for each preprocessor for post in job.postprocessors: # print the name io.printIndented("running postprocessor '{}'...".format(post.name), 1) # see if it has already ran if self.shouldPostprocess(job.name, post.name): # we need to run, first gather arguments students = self.corpus.students assignments = job.assignments args = post.args helpers = self.corpus # try to import the correct module try: module = importlib.import_module('postprocessors.' + post.name) # run it print "" success = module.run(students, assignments, args, helpers) # update progress self.progress.updatePostprogress(job.name, post.name, success) except: printError( "module '{}' not found or encountered an error.\n". format(post.name)) success = False if success: io.printIndented('complete!\n', 1) else: # fail out break else: # don't need to run io.printRaw(' already done!\n') # return true iff all were sucessful return success
def runPostprocess(self, job): success = True # for each preprocessor for post in job.postprocessors: # print the name io.printIndented("running postprocessor '{}'...".format(post.name), 1) # see if it has already ran if self.shouldPostprocess(job.name, post.name): # we need to run, first gather arguments students = self.corpus.students assignments = job.assignments args = post.args helpers = self.corpus # try to import the correct module try: module = importlib.import_module('postprocessors.' + post.name) # run it print "" success = module.run(students, assignments, args, helpers) # update progress self.progress.updatePostprogress(job.name, post.name, success) except: printError("module '{}' not found or encountered an error.\n".format(post.name)) success = False if success: io.printIndented('complete!\n', 1) else: # fail out break else: # don't need to run io.printRaw(' already done!\n') # return true iff all were sucessful return success
def printf(self, text): io.printIndented(text, 2)
def printError(text): io.printIndented(text, 1) io.printLine() traceback.print_exc() io.printLine()
def printError(text): io.printIndented(text, 1) io.printLine() traceback.print_exc() io.printLine()
def printf(self, text): io.printIndented(text, 2)