Commit 68ddcf4
Global scope setters (getsentry#540)
* master: (sentry_sdk/utils.py) add push_scope_decorator
* master: (sentry_sdk/utils.py) fix iteritems incompatibility
* master: (sentry_sdk/utils.py) reformat push_scope_decorator() to fit linter specs
* push-scope-decorator: (utils.py) remove push_scope_decorator, (hub.py) update Hub.push_scope() to allow it to act as both a contentmanager and a decorator, (api.py, utils.py) add new scopemethod api methods {set_tag, set_extra, set_user, set_level} that allow for updating of the current scope
* push-scope-decorator: (sentry_sdk/hub.py) have _PushScopeContextDecorator inherit from contextlib.ContextDecorator
* push-scope-decorator: (sentry_sdk/hub.py) combine _PushScopeContextDecorator with _ScopeManager
* push-scope-decorator: (hub.py) fix push_scope() typing
* master: (sentry_sdk/_compat.py, sentry_sdk/hub.py) resolve py2 ContextDecorator compat issue, (sentry_sdk/api.py) update typing to match that of Hub.push_scope()
* master: (sentry_sdk/scope.py) remove improper uses of @_attr_setter, (tests/test_basics.py) remove unneeded test_scope_leaks_cleaned_up()
* master: (tests/test_basics.py) add test for push_scope as decorator, (sentry_sdk/_compat.py) satisfy linters
* global-scope-setters: keep global scope setters and remove push_scope() 'as a decorator' code
* global-scope-setters: (api.py) change 'current_scope' property to 'scope'
* global-scope-setters: (hub.py) add new lines in docstring to match style in rest of file
* global-scope-setters: (api.py) add global for set_context1 parent 75f09c3 commit 68ddcf4
3 files changed
+73
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
163 | 178 | | |
164 | 179 | | |
165 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
166 | 221 | | |
167 | 222 | | |
168 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
| |||
483 | 489 | | |
484 | 490 | | |
485 | 491 | | |
486 | | - | |
487 | | - | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
| |||
0 commit comments