~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to bin/ivle-addexercise

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os, sys, traceback
24
24
import xml.dom.minidom as minidom
25
25
 
26
 
from ivle.config import Config
27
26
from ivle.database import Exercise, TestSuite, TestCase, TestSuiteVar, TestCasePart, get_store
28
27
 
29
28
class XMLMalformedError(Exception):
62
61
    cases = []
63
62
    case_num = 0
64
63
    for case_node in suite_node.getElementsByTagName('function'):
 
64
        case_num += 1
65
65
        cases.append(add_test_case(case_node, case_num, store))
66
 
        case_num += 1
67
66
 
68
67
    ## ALLOWED TAGS ##
69
68
    # stdin     - Stdin for the suite - Unique - Text inside element
176
175
xmlfile = sys.argv[1]
177
176
 
178
177
def add_exercise(xmlfile):
 
178
    store = get_store()
 
179
 
179
180
    # Skip existing ones.
180
181
    if store.find(Exercise, id=unicode(xmlfile)).count():
181
182
        return
238
239
 
239
240
    store.add(new_exercise)
240
241
    store.commit()
241
 
 
242
 
store = get_store(Config())
243
 
 
 
242
    
244
243
xmlfiles = sys.argv[1:]
245
244
for xmlfile in xmlfiles:
246
245
    try: