texts_cli.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. """A module with all the display info for whallets-cli."""
  2. from tabulate import tabulate
  3. import whallets_cli as cli
  4. def _welcome_message():
  5. """welcoming message to the cli"""
  6. msg = \
  7. "\n=========================================\n"\
  8. "WELCOME TO WHALLETS CLI"\
  9. "\n========================================="
  10. return msg
  11. def _main_menu():
  12. """Displays the CLI main menu"""
  13. line_0 = ("**","Chose an operation from the menu:")
  14. line = ("---","---------------------------------",)
  15. line_1 = ("1 -","Add a wallet to the your list")
  16. line_2 = ("2 -","Remove a wallet from your list")
  17. line_3 = ("3 -","Display your wallet list")
  18. line_4 = ("4 -","Display recent whale TXs on your EVM list")
  19. line_5 = ("5 -","Display recent whale TXs on your SPL list")
  20. line_q = ("q -","Quit!")
  21. table = [
  22. line_0,
  23. line,
  24. line_1,
  25. line_2,
  26. line_3,
  27. line_4,
  28. line_5,
  29. line_q
  30. ]
  31. return table
  32. def _menu_choice():
  33. """Sentence asking user for the next step"""
  34. msg = "\nEnter number and press Enter: "
  35. return msg
  36. def _missing_operation():
  37. """Inform about non-existing users choice"""
  38. msg = "Sorry, but you had either choosen an unexisting option, "\
  39. "or this operation has not been developped yet."
  40. return msg
  41. def _ask_new_choice():
  42. """Message offering a new choice or quit"""
  43. msg = \
  44. "\n\n=========================================\n"\
  45. "Do you have another choice?\n1 - YES\n2 - NO (quit)\n"
  46. return msg
  47. def _choose_network():
  48. """Gives a choice of networks to work with"""
  49. line_0 = ("**","Please chose the network for the wallet address:")
  50. line = ("---", "---------------------------------",)
  51. line_1 = ("1 -","EVM; Etherum main net and any forks (BSC, Poly..)")
  52. line_2 = ("2 -","SPL; Solana Program Platform")
  53. line_3 = ("3 -","BTC; Bitcoin")
  54. table = [ line_0, line, line_1, line_2, line_3]
  55. return table
  56. def _prompt_address():
  57. """Ask or the wallet address"""
  58. msg = "\nEnter the wallet address:\n"
  59. return msg
  60. def _prompt_twitter():
  61. """Ask or the wallet address"""
  62. msg = "\nEnter the twitter link (full address):\n"
  63. return msg
  64. def _prompt_info():
  65. """Ask or the wallet address"""
  66. msg = "\nEnter short info about the user:\n"
  67. return msg
  68. def _prompt_name():
  69. """Ask or the wallet address"""
  70. msg = "\nEnter user/wallet name/tag:\n"
  71. return msg
  72. def _prompt_ens():
  73. """Ask or the wallet address"""
  74. msg = "\nEnter user's ENS:\n"
  75. return msg
  76. def _display_wallet_check_result(y):
  77. """displays answer based on added data"""
  78. msg_0 = \
  79. f"{x.title()} already exists in your wallet dictionary."\
  80. f"\nDo you want to continue?\n1 - YES\n2 - NO (change the item)"\
  81. f"{_menu_choice()}"
  82. msg_1 = \
  83. f"The new wallet will be saved with already existing info:\n"
  84. return msg_0, msg_1
  85. def _enter_new_info(y):
  86. """Asks user for a correct information"""
  87. msg = f"\nPlease write a correct {y}:\n\n"
  88. return msg