Revision 2027
Added by Aaron Marcuse-Kubitza almost 13 years ago
map | ||
---|---|---|
225 | 225 |
def process_row(row, i): |
226 | 226 |
row_id = str(i) |
227 | 227 |
for in_, out in mappings: |
228 |
log_debug('Getting '+str(in_)) |
|
228 | 229 |
value = metadata_value(in_) |
229 |
if value == None: |
|
230 |
log_debug('Getting '+str(in_)) |
|
231 |
value = cleanup(get_value(in_, row)) |
|
230 |
if value == None: value = cleanup(get_value(in_, row)) |
|
231 |
log_debug('Putting '+repr(value)+' to '+str(out)) |
|
232 | 232 |
if out_is_db or value != None: |
233 |
log_debug('Putting '+str(out)) |
|
234 | 233 |
xpath.put_obj(root, out, row_id, has_types, value) |
234 |
if debug: log_debug('Putting:\n'+str(root))# only str() if debug |
|
235 | 235 |
return process_rows(process_row, rows, **kw_args) |
236 | 236 |
|
237 | 237 |
def map_table(col_names, rows, **kw_args): |
Also available in: Unified diff
bin/map: If out_is_db, in debug mode, print each row's XML tree and each value that it's putting