self.name = project.name self.tags = str(project).split("\n") self.tags = self.tags[0] def html(self): print ('<tr>') print ('<td>' + mcgi.quickCheckbox(self.filename) + '</td>') print ('<td><a href="load_project.py?load='+self.filename+'">'+self.name+'</a></td>') print ('<td>'+self.tags+'</td>') print ('<td>'+self.ctime_date+'</td>') print ('<td>'+self.ctime_time+'</td>') print ('<td><a href="templates/'+self.filename+'" download>'+self.filename+'</a></td>') print ('</tr>') mcgi.frame() form = cgi.FieldStorage() for templatefile in os.listdir("/MouseCandy/templates/"): if form.getvalue(templatefile) == "del": print ('<p>'+templatefile+" deleted</p>") os.remove("/MouseCandy/templates/"+templatefile) templatefiles = [] for filename in os.listdir("/MouseCandy/templates/"): templatefiles.append(Template(filename)) def getkey(custom): return custom.ctime templatefiles = sorted(templatefiles, key=getkey, reverse=True) print('<form action="templates.py" method="post">')
#!/usr/bin/python2 import mcgi, mclass import fvalues import pmaker import os mcgi.frame() err = False #Check for stim length error (generic) if fvalues.stim_length is None: err = True #Check for GNG specific errors if fvalues.ptype == "gng": #Check for OlfactoryGNG specific errors if fvalues.stim_type == "olfactory": if fvalues.positive_valve == fvalues.negative_valve: err = True if fvalues.positive_valve == fvalues.blank_valve: err = True if fvalues.negative_valve == fvalues.blank_valve: err = True #Check for AudioGNG specific errors if fvalues.stim_type == "audio": if fvalues.positive_tone_hz is None: err = True if fvalues.negative_tone_hz is None: err = True #Check for VisualGNG specific errors if fvalues.stim_type == "visual": if fvalues.positive_animation is None: err = True if fvalues.negative_animation is None: err = True if fvalues.positive_animation == fvalues.negative_animation: err = True