|
34 | 34 | from cve_bin_tool.sbom_manager.generate import SBOMGenerate
|
35 | 35 | from cve_bin_tool.version import VERSION
|
36 | 36 | from cve_bin_tool.vex_manager.generate import VEXGenerate
|
37 |
| - |
| 37 | +from cve_bin_tool.cvedb import DISK_LOCATION_DEFAULT |
38 | 38 |
|
39 | 39 | def save_intermediate(
|
40 | 40 | all_cve_data: dict[ProductInfo, CVEData],
|
@@ -130,9 +130,10 @@ def output_pdf(
|
130 | 130 | exploits: bool = False,
|
131 | 131 | metrics: bool = False,
|
132 | 132 | all_product_data=None,
|
| 133 | + cachedir: str = DISK_LOCATION_DEFAULT, |
133 | 134 | ):
|
134 | 135 | """Output a PDF of CVEs"""
|
135 |
| - cvedb_data = CVEDB() |
| 136 | + cvedb_data = CVEDB(cachedir=cachedir) |
136 | 137 | db_date = time.strftime(
|
137 | 138 | "%d %B %Y at %H:%M:%S", time.localtime(cvedb_data.get_db_update_date())
|
138 | 139 | )
|
@@ -595,6 +596,7 @@ def output_pdf(
|
595 | 596 | affected_versions: int = 0,
|
596 | 597 | exploits: bool = False,
|
597 | 598 | all_product_data=None,
|
| 599 | + cachedir: str = DISK_LOCATION_DEFAULT |
598 | 600 | ):
|
599 | 601 | """Output a PDF of CVEs
|
600 | 602 | Required module: Reportlab not found"""
|
@@ -673,6 +675,7 @@ def __init__(
|
673 | 675 | vex_product_info: dict[str, str] = {},
|
674 | 676 | offline: bool = False,
|
675 | 677 | organized_arguements: dict = None,
|
| 678 | + cachedir: str = DISK_LOCATION_DEFAULT |
676 | 679 | ):
|
677 | 680 | """Constructor for OutputEngine class."""
|
678 | 681 | self.logger = logger or LOGGER.getChild(self.__class__.__name__)
|
@@ -705,6 +708,7 @@ def __init__(
|
705 | 708 | self.vex_type = vex_type
|
706 | 709 | self.vex_product_info = vex_product_info
|
707 | 710 | self.vex_filename = vex_filename
|
| 711 | + self.cachedir = cachedir |
708 | 712 |
|
709 | 713 | def output_cves(self, outfile, output_type="console"):
|
710 | 714 | """Output a list of CVEs
|
@@ -752,6 +756,7 @@ def output_cves(self, outfile, output_type="console"):
|
752 | 756 | self.affected_versions,
|
753 | 757 | self.exploits,
|
754 | 758 | self.metrics,
|
| 759 | + self.cachedir, |
755 | 760 | )
|
756 | 761 | elif output_type == "html":
|
757 | 762 | output_html(
|
|
0 commit comments