From 28a61e3321dca2b3c79f662557b9a22b708b4208 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 19 Sep 2024 13:25:16 +0300 Subject: [PATCH] chore: finalize python sdk example --- frontend/src/component/onboarding/sdkSnippets.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/onboarding/sdkSnippets.ts b/frontend/src/component/onboarding/sdkSnippets.ts index f573c76a8e38..66b634891f72 100644 --- a/frontend/src/component/onboarding/sdkSnippets.ts +++ b/frontend/src/component/onboarding/sdkSnippets.ts @@ -99,11 +99,13 @@ var settings = new UnleashSettings() Unleash unleash = new DefaultUnleash(config);`, Python: `from UnleashClient import UnleashClient +import time client = UnleashClient( url="", app_name="unleash-onboarding-python", - custom_headers={'Authorization': '"'}) + refresh_interval=5, + custom_headers={'Authorization': ''}) client.initialize_client()`, JavaScript: `import { UnleashClient } from 'unleash-proxy-client'; @@ -217,7 +219,12 @@ export const checkFlagCodeSnippets: Record = { Rust: ``, '.NET': ``, Java: ``, - Python: ``, + Python: `try: + while True: + print(client.is_enabled("dEE")) + time.sleep(1) +except KeyboardInterrupt: + client.destroy()`, JavaScript: ``, React: ``, Vue: ``,