Пример #1
0
        "note": "string",
        "percentCorrect": "string",
        "frequency": "string",
        "presentationTime": "string",
        "date": "string",
        "pedestalContrast": "string",
        "noiseContrast": "string",
        "noiseType": "string",
    }


m.register(*objects)
xmlio = XmlIO(m, objects)
xmlio.read_file("demo/xml.xml")

with m.auto_session as session:
    e = Experiment()
    session.add(e)

print ET.tostring(xmlio.write())

from xml.dom.minidom import parseString


def prettyPrint(element):
    txt = ET.tostring(element)
    print parseString(txt).toprettyxml()


prettyPrint(xmlio.write())
Пример #2
0
print ""
obs_1.print_tree()
print ""
trial1_1.print_tree()

#exp_neptune.attach("C", obs_1)

from xdapy.structures import Context

print m.find_all(Context)
#m.delete(obs_1)
#print m.find_all(Context)

m.delete(*m.find_all(Context))


print m.find_all(Context)
print m.find_all(Experiment)


contx = m.find_first(Context)
#m.registerConnection(Experiment, Observer, "Observer")

exp_monorail.attach("Observer", obs_1)

from xdapy.io import XmlIO
xmlio = XmlIO(m, Entity.__subclasses__())
print xmlio.write()

db.drop_tables()