Load an image, optionally resizing it by the given scale factor.
(self, image_path, scale=None)
| 1728 | else: |
| 1729 | logger.warning("actions.json not found - status animations will be unavailable") |
| 1730 | except Exception as e: |
| 1731 | logger.error(f"Error loading actions.json: {e}") |
| 1732 | |
| 1733 | def initialize_csv(self): |
| 1734 | """Initialize the network knowledge base CSV file with headers.""" |
| 1735 | logger.info("Initializing the network knowledge base CSV file with headers") |
| 1736 | try: |
| 1737 | if not os.path.exists(self.netkbfile): |
| 1738 | try: |
| 1739 | with open(self.actions_file, 'r') as file: |
| 1740 | actions = json.load(file) |
| 1741 | action_names = [action["b_class"] for action in actions if "b_class" in action] |
| 1742 | except FileNotFoundError as e: |
| 1743 | logger.error(f"Actions file not found: {e}") |
| 1744 | return |
| 1745 | except json.JSONDecodeError as e: |
| 1746 | logger.error(f"Error decoding JSON from actions file: {e}") |
| 1747 | return |
| 1748 | except Exception as e: |
| 1749 | logger.error(f"Unexpected error reading actions file: {e}") |
no test coverage detected