MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / display_csv

Method display_csv

actions/scanning.py:893–912  ·  view source on GitHub ↗

Displays the contents of the specified CSV file using Rich for enhanced visualization.

(self, file_path)

Source from the content-addressed store, hash-verified

891 self.logger.error(f"Error in update_netkb: {e}")
892
893 def display_csv(self, file_path):
894 """
895 Displays the contents of the specified CSV file using Rich for enhanced visualization.
896 """
897 if not Table or not self.console:
898 return
899 with self.lock:
900 try:
901 table = Table(title=f"Contents of {file_path}", show_lines=True)
902 with open(file_path, 'r') as file:
903 reader = csv.reader(file)
904 headers = next(reader)
905 for header in headers:
906 table.add_column(header, style="cyan", no_wrap=True)
907 for row in reader:
908 formatted_row = [Text(cell, style="green bold") if cell else Text("", style="on red") for cell in row]
909 table.add_row(*formatted_row)
910 self.console.print(table)
911 except Exception as e:
912 self.logger.error(f"Error in display_csv: {e}")
913
914 def get_network(self):
915 """

Callers 1

scanMethod · 0.95

Calls 2

printMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected