Skip to content

Commit

Permalink
Merge pull request #98 from launchdarkly/eb/ch17280/doc-edits
Browse files Browse the repository at this point in the history
misc doc comment/readme edits prior to publishing docs
  • Loading branch information
eli-darkly authored Feb 12, 2019
2 parents 125d359 + f586cd1 commit 0972671
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,22 @@ The SDK is tested with the most recent patch releases of Python 2.7, 3.3, 3.4, 3
Database integrations
---------------------

Feature flag data can be kept in a persistent store using Consul, DynamoDB, or Redis. These adapters are implemented in the `Consul`, `DynamoDB` and `Redis` classes in `ldclient.integrations`; to use them, call the `new_feature_store` method in the appropriate class, and put the returned object in the `feature_store` property of your client configuration. See [`ldclient.integrations`](https://github.com/launchdarkly/python-client-private/blob/master/ldclient/integrations.py) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store) for more information.
Feature flag data can be kept in a persistent store using Consul, DynamoDB, or Redis. These adapters are implemented in the `Consul`, `DynamoDB` and `Redis` classes in `ldclient.integrations`; to use them, call the `new_feature_store` method in the appropriate class, and put the returned object in the `feature_store` property of your client configuration. See [`ldclient.integrations`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-integrations.html#module-ldclient.integrations) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store) for more information.

Note that Consul is not supported in Python 3.3 or 3.4.

Using flag data from a file
---------------------------

For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See [`file_data_source.py`](https://github.com/launchdarkly/python-client/blob/master/ldclient/file_data_source.py) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/reading-flags-from-a-file) for more details.
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See [`ldclient.integrations.Files`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-integrations.html#ldclient.integrations.Files) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/reading-flags-from-a-file) for more details.

Learn more
-----------
----------

Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](http://docs.launchdarkly.com/docs/python-sdk-reference).

Generated API documentation is on [readthedocs.io](https://launchdarkly-python-sdk.readthedocs.io/en/latest/).

Testing
-------

Expand All @@ -116,16 +118,18 @@ About LaunchDarkly
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
* LaunchDarkly provides feature flag SDKs for
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "LaunchDarkly Java SDK")
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
* [Electron](http://docs.launchdarkly.com/docs/electron-sdk-reference "LaunchDarkly Electron SDK")
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
* [C/C++](http://docs.launchdarkly.com/docs/c-sdk-reference "LaunchDarkly C/C++ SDK")
* Explore LaunchDarkly
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
Expand Down
14 changes: 12 additions & 2 deletions ldclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def _send_event(self, event):
def track(self, event_name, user, data=None):
"""Tracks that a user performed an event.
LaunchDarkly automatically tracks pageviews and clicks that are specified in the Goals
section of the dashboard. This can be used to track custom goals or other events that do
not currently have goals.
:param string event_name: the name of the event, which may correspond to a goal in A/B tests
:param dict user: the attributes of the user
:param data: optional additional data associated with the event
Expand Down Expand Up @@ -199,12 +203,17 @@ def is_offline(self):
def is_initialized(self):
"""Returns true if the client has successfully connected to LaunchDarkly.
If this returns false, it means that the client has not yet successfully connected to LaunchDarkly.
It might still be in the process of starting up, or it might be attempting to reconnect after an
unsuccessful attempt, or it might have received an unrecoverable error (such as an invalid SDK key)
and given up.
:rtype: bool
"""
return self.is_offline() or self._config.use_ldd or self._update_processor.initialized()

def flush(self):
"""Flushes all pending events.
"""Flushes all pending analytics events.
Normally, batches of events are delivered in the background at intervals determined by the
``flush_interval`` property of :class:`ldclient.config.Config`. Calling ``flush()``
Expand Down Expand Up @@ -400,7 +409,8 @@ def all_flags_state(self, user, **kwargs):
return state

def secure_mode_hash(self, user):
"""Generates a hash value for a user, for use by the JavaScript SDK.
"""Computes an HMAC signature of a user signed with the client's SDK key,
for use with the JavaScript SDK.
For more information, see the JavaScript SDK Reference Guide on
`Secure mode <https://github.com/launchdarkly/js-client#secure-mode>`_.
Expand Down

0 comments on commit 0972671

Please sign in to comment.