1- import atexit
1+ from contextlib import contextmanager
2+
3+ import sentry_minimal
24
35from .hub import Hub
6+ from .scope import Scope
47from .client import Client
58
69
7- __all__ = ['Hub' , 'Client' ]
10+ __all__ = ['Hub' , 'Client' , 'init' ] + sentry_minimal . __all__
811
912
10- def public (f ):
11- __all__ .append (f .__name__ )
12- return f
13+ for _key in sentry_minimal .__all__ :
14+ globals ()[_key ] = getattr (sentry_minimal , _key )
1315
1416
1517class _InitGuard (object ):
@@ -26,37 +28,8 @@ def __exit__(self, exc_type, exc_value, tb):
2628 c .close ()
2729
2830
29- @public
3031def init (* args , ** kwargs ):
3132 client = Client (* args , ** kwargs )
3233 if client .dsn is not None :
3334 Hub .main .bind_client (client )
3435 return _InitGuard (client )
35-
36-
37- @public
38- def capture_event (event ):
39- hub = Hub .current
40- if hub is not None :
41- return hub .capture_event (event )
42-
43-
44- @public
45- def capture_message (message , level = None ):
46- hub = Hub .current
47- if hub is not None :
48- return hub .capture_message (message , level )
49-
50-
51- @public
52- def capture_exception (error = None ):
53- hub = Hub .current
54- if hub is not None :
55- return hub .capture_exception (error )
56-
57-
58- @public
59- def add_breadcrumb (crumb ):
60- hub = Hub .current
61- if hub is not None :
62- return hub .add_breadcrumb (crumb )
0 commit comments