Revision 3660
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/db_xml.py | ||
---|---|---|
51 | 51 |
|
52 | 52 |
put_special_funcs = set(['_simplifyPath']) |
53 | 53 |
|
54 |
def put(db, node, row_ins_ct_ref=None, on_error=exc.raise_,
|
|
54 |
def put(db, node, row_ins_ct_ref=None, on_error=exc.reraise,
|
|
55 | 55 |
col_defaults={}, in_table=None, parent_ids_loc=None, next=None): |
56 | 56 |
def put_(node, in_row_ct_ref=None): |
57 | 57 |
return put(db, node, row_ins_ct_ref, on_error, col_defaults, |
... | ... | |
167 | 167 |
input_col_prefix = '$' |
168 | 168 |
|
169 | 169 |
def put_table(db, node, in_table, in_row_ct_ref=None, row_ins_ct_ref=None, |
170 |
limit=None, start=0, on_error=exc.raise_, col_defaults={}):
|
|
170 |
limit=None, start=0, on_error=exc.reraise, col_defaults={}):
|
|
171 | 171 |
''' |
172 | 172 |
@param node The XML tree that transforms the input to the output. Similar to |
173 | 173 |
put()'s node param, but with the input column name prefixed by |
lib/xml_func.py | ||
---|---|---|
75 | 75 |
|
76 | 76 |
def is_xml_func(node): return is_xml_func_name(node.tagName) |
77 | 77 |
|
78 |
def process(node, on_error=exc.raise_, is_rel_func=None, db=None):
|
|
78 |
def process(node, on_error=exc.reraise, is_rel_func=None, db=None):
|
|
79 | 79 |
'''Evaluates the XML functions in an XML tree. |
80 | 80 |
@param is_rel_func None|f(str) Tests if a name is a relational function. |
81 | 81 |
* If != None: Non-relational functions are removed, or relational |
lib/sql_io.py | ||
---|---|---|
234 | 234 |
return str_ |
235 | 235 |
|
236 | 236 |
def put_table(db, out_table, in_tables, mapping, row_ct_ref=None, default=None, |
237 |
col_defaults={}, on_error=exc.raise_):
|
|
237 |
col_defaults={}, on_error=exc.reraise):
|
|
238 | 238 |
'''Recovers from errors. |
239 | 239 |
Only works under PostgreSQL (uses INSERT RETURNING). |
240 | 240 |
IMPORTANT: Must be run at the *beginning* of a transaction. |
Also available in: Unified diff
Use new exc.reraise() where exc.raise_() was used, so that the stack trace is preserved when the exception is rethrown