Kaynağa Gözat

adding csv export option

serinko 4 yıl önce
ebeveyn
işleme
b7781836cf
2 değiştirilmiş dosya ile 12 ekleme ve 5 silme
  1. 5 2
      texts_cli.py
  2. 7 3
      whallets_cli.py

+ 5 - 2
texts_cli.py

@@ -173,8 +173,11 @@ def _display_database(i, user, info, twitter,):
             "===========","===========","===========")
 
 
-def _display_wallets(wlt, address, networks):
-    """displays wallets within a given user"""
+def _csv_exported():
+    """displays information about csv stored"""
+    msg = "\nThe wallet database was exported to ~/whallets/data/whallets.csv."
+    return msg
+
 
 
 

+ 7 - 3
whallets_cli.py

@@ -41,6 +41,9 @@ def main_menu_choice():
     elif choice == '5':
         print(tc._missing_operation())
         _new_choice()
+    elif choice == '6':
+        print(tc._missing_operation())
+        _new_choice()
     elif choice.lower() == "q":
         quit()
     else:
@@ -291,8 +294,8 @@ def table_format_wallets(chain):
 
     # table = []
     line_0 = [
-    "INDEX", "USER", "ENS", "TWITTER", "INFO", "ADDRESSES", "NETWORKS"]
-    line_ = ["===========", "===========", "===========", "===========",
+    "#", "USER", "ENS", "TWITTER", "INFO", "ADDRESSES", "NETWORKS"]
+    line_ = ["==", "===========", "===========", "===========",
             "===========", "===========", "==========="]
     table = [line_0, line_,]
 
@@ -330,7 +333,7 @@ def table_format_wallets(chain):
 
 def csv_export():
     table = table_format_wallets('evm')
-    file = 'whales.csv'
+    file = 'data/whallets.csv'
     # with open(file, 'wb') as output:
     #     new_writer = csv.writer(output)
     #     new_writer.writerows(table)
@@ -338,6 +341,7 @@ def csv_export():
         new_writer = csv.writer(output)
         for row in table:
             new_writer.writerow(row)
+    print(tc._csv_exported())
 
 
 def _chain_index(chain):