Skip to content

Commit

Permalink
Feature: diff between two given xml, without storing to the database
Browse files Browse the repository at this point in the history
  • Loading branch information
dimeko committed May 20, 2024
1 parent 4a6d82e commit 9d26a72
Show file tree
Hide file tree
Showing 15 changed files with 549 additions and 340 deletions.
15 changes: 7 additions & 8 deletions deltascan/cli/cli_output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from deltascan.core.utils import (diffs_to_output_format,
format_string)
from deltascan.core.utils import (format_string)
from deltascan.core.output import Output
from deltascan.core.schemas import ReportScanFromDB, ReportDiffs
from deltascan.core.exceptions import DScanMethodNotImplemented
Expand All @@ -9,7 +8,7 @@
from rich.table import Table
from rich.panel import Panel
from rich.columns import Columns

from deltascan.core.parser import Parser
import datetime


Expand Down Expand Up @@ -59,7 +58,7 @@ def _validate_data(self, data):
articulated_diffs.append(
{"date_from": diff["dates"][1],
"date_to": diff["dates"][0],
"diffs": diffs_to_output_format(diff),
"diffs": Parser.diffs_to_output_format(diff),
"generic": diff["generic"],
"uuids": diff["uuids"]})
for d in articulated_diffs:
Expand Down Expand Up @@ -279,17 +278,17 @@ def display(self):
None
"""
tables = self._display()
panel = Panel.fit(Columns(tables), title=self._display_title, border_style="conceal")
panel = Panel.fit(Columns(tables), title=self._display_title)

self.console.print(panel)
return self._index_to_uuid_mapping

@classmethod
def profiles(cls, profiles):
_profiles_table = Table(show_header=True)
_profiles_table.add_column("Name", style="bright_yellow", no_wrap=True)
_profiles_table.add_column("Arguments", style="rosy_brown", no_wrap=True)
_profiles_table.add_column("Created at", style="bright_yellow", no_wrap=True)
_profiles_table.add_column("Name", style="bright_yellow", no_wrap=False, width=50)
_profiles_table.add_column("Arguments", style="rosy_brown", no_wrap=False)
_profiles_table.add_column("Created at", style="bright_yellow", no_wrap=False, width=30)

for profile in profiles:
_profiles_table.add_row(profile["profile_name"], profile["arguments"], str(profile["created_at"]))
Expand Down
Loading

0 comments on commit 9d26a72

Please sign in to comment.