serinko il y a 4 ans
Parent
commit
2369be6735
2 fichiers modifiés avec 16 ajouts et 19 suppressions
  1. 2 2
      texts_cli.py
  2. 14 17
      whallets_cli.py

+ 2 - 2
texts_cli.py

@@ -100,10 +100,10 @@ def _prompt_ens():
     return msg
     return msg
 
 
 
 
-def _display_wallet_check_result(y):
+def _display_wallet_check_result(z):
     """displays answer based on added data"""
     """displays answer based on added data"""
     msg_0 = \
     msg_0 = \
-        f"{y.title()} already exists in your wallet dictionary."\
+        f"\nThis {z} already exists in your wallet dictionary."\
         f"\nDo you want to continue?\n1 - YES (keep it duplicate)"\
         f"\nDo you want to continue?\n1 - YES (keep it duplicate)"\
         f"\n2 - NO (change the item)"\
         f"\n2 - NO (change the item)"\
         f"{_menu_choice()}"
         f"{_menu_choice()}"

+ 14 - 17
whallets_cli.py

@@ -143,27 +143,24 @@ def check_wallet_item(ntw_i,x):
 
 
     return new_item
     return new_item
 
 
-    # else:
-    #     print(tc._display_wallet_check_result(y)[1])
-    #     new_item = True
-    #
-    # wlt = [ntw_i, name, addr, twtr, ens, inf]
-    #
-    # if new_item != True:
-    #     wlt[x] = new_item
-    #
-    # return wlt
-
 def _correct_item(x,z):
 def _correct_item(x,z):
     """Allows user to rewrite an exisitng item in the wallet"""
     """Allows user to rewrite an exisitng item in the wallet"""
-    a = (input(tc._display_wallet_check_result(z)[0]))
+    a = '2'
+    while a == '2':
+        a = (input(tc._display_wallet_check_result(z)[0]))
+
+        if a == '1':
+            new_item = x
 
 
-    if a == '1':
-        new_item = x
+        elif a == '2':
+            new_item = input(tc._enter_new_info(z))
+            if new_item == x:
+                a = '2'
+            else:
+                new_item = x
+                return new_item
+                break
 
 
-    elif a == '2':
-        new_item = input(tc._enter_new_info(z))
-        return new_item
 
 
 
 
 def get_wallets():
 def get_wallets():