Esempio n. 1
0
    def print_disk_chart(self, ch: Chart, partname: str, part: dict) -> None:
        """Prints the disk data as a chart
        
        Args:
            ch (Chart): to print
            partname (str): partition title
            part (dict): parition data to be visualized
        """
        pre_graph_text = self.create_stats(part)

        footer = None
        if self.details:
            footer = self.create_details_text(part)

        maximum = part["total"]
        current = part["used"]
        post_graph_text = create_usage_warning(part['percent'], 80, 60)

        ch.chart(
            post_graph_text=post_graph_text,
            title=partname,
            pre_graph_text=pre_graph_text,
            footer=footer,
            maximum=maximum,
            current=current,
        )
        print()
Esempio n. 2
0
    def print_battery_chart(self, chart: Chart) -> None:
        """ Prints battery information chart """
        post_graph_text = str(ceil(100 * self._battery.percent) / 100) + "%"
        footer = self.create_details_text()

        chart.chart(
            post_graph_text=post_graph_text,
            pre_graph_text=None,
            title="Battery",
            footer=footer,
            maximum=100,
            current=self._battery.percent,
        )
        print()