Project

General

Profile

« Previous | Next » 

Revision 118

test/map: Added support for database input

View differences:

map
69 69
    if map_path != None:
70 70
        doc1 = xml.dom.minidom.getDOMImplementation().createDocument(None,
71 71
            dest, None)
72
        if in_is_xml: raise Exception('XML-XML mapping not supported yet')
72
        if in_is_xml: raise SystemExit('XML-XML mapping not supported yet')
73 73
        elif in_is_db:
74
            import psycopg2
75
            
74 76
            import db_xml
75 77
            
76 78
            in_db = psycopg2.connect(**in_db_config)
77 79
            for in_, out in mappings:
78 80
                value = metadata_value(in_)
79 81
                if value == None:
80
                    raise Exception('DB-XML mapping not supported yet')
82
                    raise SystemExit('DB-XML mapping not supported yet')
81 83
            in_db.close()
82 84
        else: # input is CSV
83 85
            metadata = []

Also available in: Unified diff