File tree Expand file tree Collapse file tree 5 files changed +10
-15
lines changed Expand file tree Collapse file tree 5 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def set_config(config):
32
32
re-initialized with the new configuration (this will result in the next call to :func:`ldclient.get()`
33
33
returning a new client instance).
34
34
35
- :param string sdk_key : the new SDK key
35
+ :param ldclient.config.Config config : the client configuration
36
36
"""
37
37
global __config
38
38
global __client
@@ -93,7 +93,7 @@ def get():
93
93
"""Returns the shared SDK client instance, using the current global configuration.
94
94
95
95
To use the SDK as a singleton, first make sure you have called :func:`ldclient.set_sdk_key()` or
96
- :func:`ldclient.set_config()` at startup time. Then `get()` will return the same shared
96
+ :func:`ldclient.set_config()` at startup time. Then `` get()` ` will return the same shared
97
97
:class:`ldclient.client.LDClient` instance each time. The client will be initialized if it has
98
98
not been already.
99
99
Original file line number Diff line number Diff line change @@ -71,10 +71,6 @@ class LDClient(object):
71
71
def __init__ (self , sdk_key = None , config = None , start_wait = 5 ):
72
72
"""Constructs a new LDClient instance.
73
73
74
- Rather than calling this constructor directly, you can call the `ldclient.set_sdk_key`,
75
- `ldclient.set_config`, and `ldclient.get` functions to configure and use a singleton
76
- client instance.
77
-
78
74
:param string sdk_key: the SDK key for your LaunchDarkly environment
79
75
:param ldclient.config.Config config: optional custom configuration
80
76
:param float start_wait: the number of seconds to wait for a successful connection to LaunchDarkly
@@ -203,7 +199,7 @@ def is_offline(self):
203
199
def is_initialized (self ):
204
200
"""Returns true if the client has successfully connected to LaunchDarkly.
205
201
206
- :rype : bool
202
+ :rtype : bool
207
203
"""
208
204
return self .is_offline () or self ._config .use_ldd or self ._update_processor .initialized ()
209
205
Original file line number Diff line number Diff line change @@ -166,9 +166,8 @@ def copy_with_new_sdk_key(self, new_sdk_key):
166
166
user_keys_flush_interval = self .__user_keys_flush_interval ,
167
167
inline_users_in_events = self .__inline_users_in_events )
168
168
169
+ # for internal use only - probably should be part of the client logic
169
170
def get_default (self , key , default ):
170
- """Used internally by the SDK client to get the default value for a flag.
171
- """
172
171
return default if key not in self .__defaults else self .__defaults [key ]
173
172
174
173
@property
@@ -179,22 +178,22 @@ def sdk_key(self):
179
178
def base_uri (self ):
180
179
return self .__base_uri
181
180
181
+ # for internal use only - also no longer used, will remove
182
182
@property
183
183
def get_latest_flags_uri (self ):
184
- """Used internally, deprecated.
185
-
186
- .. deprecated:: 5.0.0
187
- """
188
184
return self .__base_uri + GET_LATEST_FEATURES_PATH
189
185
186
+ # for internal use only - should construct the URL path in the events code, not here
190
187
@property
191
188
def events_uri (self ):
192
189
return self .__events_uri + '/bulk'
193
190
191
+ # for internal use only
194
192
@property
195
193
def stream_base_uri (self ):
196
194
return self .__stream_uri
197
195
196
+ # for internal use only - should construct the URL path in the streaming code, not here
198
197
@property
199
198
def stream_uri (self ):
200
199
return self .__stream_uri + STREAM_FLAGS_PATH
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def variation_index(self):
45
45
"""The index of the returned value within the flag's list of variations, e.g.
46
46
0 for the first variation -- or None if the default value was returned.
47
47
48
- :rtype: int
48
+ :rtype: int or None
49
49
"""
50
50
return self .__variation_index
51
51
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def get_flag_reason(self, key):
63
63
:param string key: the feature flag key
64
64
:return: a dictionary describing the reason; None if reasons were not recorded, or if there was no
65
65
such flag
66
- :rtype: dict
66
+ :rtype: dict or None
67
67
"""
68
68
meta = self .__flag_metadata .get (key )
69
69
return None if meta is None else meta .get ('reason' )
You can’t perform that action at this time.
0 commit comments