From 5d14041c869c4d8d6465db283f5c1a14897dda7b Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Thu, 16 Jun 2022 16:14:57 -0400 Subject: [PATCH] Always sleep after set_preference for gen-readme.py --- test_client/gen-readme.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_client/gen-readme.py b/test_client/gen-readme.py index 716a195..725509c 100644 --- a/test_client/gen-readme.py +++ b/test_client/gen-readme.py @@ -11,7 +11,7 @@ for wallet in ['test_wallet_1', 'test_wallet_2']: LBRYSDK.set_preference(wallet, pref_key, '') # Make sure the next preference changes have a later timestamp! -time.sleep(3) +time.sleep(1.1) def code_block(code): print ("```") @@ -23,6 +23,9 @@ def code_block(code): result = eval(line) if result is not None: print(repr(result)) + if 'set_preference' in line: + # Make sure the next preference changes have a later timestamp! + time.sleep(1.1) print ("```") print("""# Test Client @@ -160,9 +163,6 @@ c1.get_remote_wallet() c1.get_preferences() """) -# Make sure the next preference changes have a later timestamp! -time.sleep(3) - print(""" Note that we're sidestepping the question of merging different changes to the same preference. The SDK resolves this, again, by timestamps. But ideally we would resolve such an issue with a user interaction (particularly if one of the changes involves _deleting_ the preference altogether). Using timestamps as the SDK does is a holdover from the current system, so we won't distract ourselves by demonstrating it here.