def do_rerun(self, handid, hw, stored_content): if not os.path.isdir(app.config['SUBMIT_DIR']): os.mkdir(app.config['SUBMIT_DIR']) user_submit = os.path.join(app.config['SUBMIT_DIR'],current_user.name) if not os.path.isdir(user_submit): os.mkdir(user_submit) user_name_submit = os.path.join(user_submit,hw.info.name) if not os.path.isdir(user_name_submit): os.mkdir(user_name_submit) user_handid_submit = os.path.join(user_name_submit,handid) if not os.path.isdir(user_handid_submit): os.mkdir(user_handid_submit) run_input.delay(handid, hw.uuid, stored_content, {}, os.path.join(user_handid_submit, 'result.csv'))
def do_handle_upload(self, handid, hw, form): # We store the user uploaded file in local storage! # We write csv data // form.csvdata.data if not os.path.isdir(app.config['SUBMIT_DIR']): os.mkdir(app.config['SUBMIT_DIR']) user_submit = os.path.join(app.config['SUBMIT_DIR'],current_user.name) if not os.path.isdir(user_submit): os.mkdir(user_submit) user_name_submit = os.path.join(user_submit,hw.info.name) if not os.path.isdir(user_name_submit): os.mkdir(user_name_submit) user_handid_submit = os.path.join(user_name_submit,handid) if not os.path.isdir(user_handid_submit): os.mkdir(user_handid_submit) if app.config['ALLOW_LOG']: f = codecs.open(os.path.join(user_handid_submit,"upload.csv"),'w') f.write(scontent) f.close() self.store_content(handid, form.csvdata.data) # Push the submission to run queue run_input.delay(handid, hw.uuid, form.csvdata.data, {}, os.path.join(user_handid_submit, 'result.csv'))
def do_handle_upload(self, handid, hw, form): # We store the user uploaded file in local storage! self.store_content(handid, form.csvdata.data) # Push the submission to run queue run_input.delay(handid, hw.uuid, form.csvdata.data, {})
def do_rerun(self, handid, hw, stored_content): run_input.delay(handid, hw.uuid, stored_content, {})