Computer Science Capstone Projects

This page provides a summary of past projects that have been completed as part of the Computer Science capstone at SLU.

#!/usr/bin/python import cgi import operator import urllib from xml.etree import ElementTree rawfile = '/faculty/goldwamh/www/www-data/data/capstone.xml' def processState(state): name = state.find('name').text schools = state.findall('institution') if schools: print """ %s """ % (4 + len(foci), name) for school in schools: sName = school.find('name').text sURL = school.find('url') if sURL is not None: sURL = sURL.text programs = [] getUnitRecurse(school, programs) first = True for program in programs: pName = program.find('name').text pURL = program.find('url') if pURL is not None: pURL = pURL.text pFoci = set([n.text for n in program.findall('focus')]) print ' ' if first: first = False if sURL: print ' %s' % (len(programs),sURL,sName) else: print ' %s' % (len(programs),sName) if pURL: print ' %s' % (pURL, pName) else: print ' %s' % pName t = program.find('type') if t is not None: print ' %s' % t.text else: print ' ' for f in foci: if f in pFoci: print ' ✓' else: print ' ' description = program.find('description') if description is not None: d = description.text.replace('\t',' ').replace('"', '"') pieces = d.split('\n\n') for k in range(len(pieces)): pieces[k] = pieces[k].replace('\n',' ') d = '\n\n'.join(pieces) while ' ' in d: d = d.replace(' ', ' ') print ' %s' % (d,d) print ' ' print """

""" def formatDescription(d): clean = [] active = False for line in d.split('\n'): line = line.strip() if line: if not active: clean.append('

') active = True clean.append(line) else: if active: clean.append('

') active = False if active: clean.append('

') return '\n'.join(clean) def body(): form = cgi.FieldStorage() tree = ElementTree.parse(rawfile) root = tree.getroot() projects = [] # list of (title,description) pairs for p in root.findall('project'): title = p.find('title') if title is not None and title.text is not None and title.text.strip(): description = p.find('description') d = description.text.strip() if description is not None else '' projects.append( (title.text.strip(), d) ) print '' print '
' print '' # main flow... print "Content-type: text/html\n\n"; body()
Michael Goldwasser
Last modified: Sunday, 26 August 2012