Revision 5911
Added by Aaron Marcuse-Kubitza about 12 years ago
map | ||
---|---|---|
39 | 39 |
import xml_func |
40 | 40 |
import xml_parse |
41 | 41 |
|
42 |
metadata_prefix = ':' |
|
42 | 43 |
collision_suffix = '/_alt/' |
43 | 44 |
|
44 | 45 |
def get_with_prefix(map_, prefixes, key): |
... | ... | |
54 | 55 |
if values != []: return values |
55 | 56 |
else: raise e # re-raise last KeyError |
56 | 57 |
|
57 |
def metadata_value(name): return None # this feature has been removed |
|
58 |
def metadata_value(name): |
|
59 |
removed_ref = [False] |
|
60 |
name = strings.remove_prefix(metadata_prefix, name, removed_ref) |
|
61 |
if removed_ref[0]: return name |
|
62 |
else: return None |
|
58 | 63 |
|
59 | 64 |
def cleanup(val): |
60 | 65 |
if val == None: return val |
... | ... | |
284 | 289 |
if id_node != None: xml_dom.set_value(id_node, row_id) |
285 | 290 |
for in_, out in mappings: |
286 | 291 |
log_debug('Getting '+strings.ustr(in_)) |
287 |
value = metadata_value(in_) |
|
292 |
value = metadata_value(in_.name)
|
|
288 | 293 |
if value == None: value = cleanup(get_value(in_, row)) |
289 | 294 |
log_debug('Putting '+strings.urepr(value)+' to ' |
290 | 295 |
+strings.ustr(out)) |
Also available in: Unified diff
bin/map: Added support for including literal metadata values in the map spreadsheet, by prefixing them with ':'