Extract a set of variables by name from another frame. Similar to extractVars(), but with a specified depth of 1, so that names are extracted exactly from above the caller. This is simply a convenience function so that the very common case (for us) of skipping exactly 1 frame doesn
(*names)
| 54 | |
| 55 | |
| 56 | def extract_vars_above(*names): |
| 57 | """Extract a set of variables by name from another frame. |
| 58 | |
| 59 | Similar to extractVars(), but with a specified depth of 1, so that names |
| 60 | are extracted exactly from above the caller. |
| 61 | |
| 62 | This is simply a convenience function so that the very common case (for us) |
| 63 | of skipping exactly 1 frame doesn't have to construct a special dict for |
| 64 | keyword passing.""" |
| 65 | |
| 66 | callerNS = sys._getframe(2).f_locals |
| 67 | return dict((k,callerNS[k]) for k in names) |
| 68 | |
| 69 | |
| 70 | def debugx(expr,pre_msg=''): |
nothing calls this directly
no outgoing calls
no test coverage detected