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

Method load_fonts

shared.py:1581–1609  ·  view source on GitHub ↗

Load the fonts, scaled for the current display size.

(self)

Source from the content-addressed store, hash-verified

1579
1580 return new_mac_count, points_awarded
1581
1582 def delete_webconsolelog(self):
1583 """Delete the web console log file."""
1584 try:
1585 if os.path.exists(self.webconsolelog):
1586 os.remove(self.webconsolelog)
1587 logger.info(f"Deleted web console log file at {self.webconsolelog}")
1588 #recreate the file
1589
1590 else:
1591 logger.info(f"Web console log file not found at {self.webconsolelog} ...")
1592
1593 except OSError as e:
1594 logger.error(f"OS error occurred while deleting web console log file: {e}")
1595 except Exception as e:
1596 logger.error(f"Unexpected error occurred while deleting web console log file: {e}")
1597
1598 def create_livestatusfile(self):
1599 """Create the live status file, it will be used to store the current status of the scan."""
1600 try:
1601 if not os.path.exists(self.livestatusfile):
1602 with open(self.livestatusfile, 'w', newline='') as csvfile:
1603 csvwriter = csv.writer(csvfile)
1604 csvwriter.writerow(['Total Open Ports', 'Alive Hosts Count', 'All Known Hosts Count', 'Vulnerabilities Count'])
1605 csvwriter.writerow([0, 0, 0, 0])
1606 logger.info(f"Created live status file at {self.livestatusfile}")
1607 else:
1608 logger.info(f"Live status file already exists at {self.livestatusfile}")
1609 except OSError as e:
1610 logger.error(f"OS error occurred while creating live status file: {e}")
1611 except Exception as e:
1612 logger.error(f"Unexpected error occurred while creating live status file: {e}")

Callers 2

__init__Method · 0.95
_deferred_initMethod · 0.95

Calls 3

load_fontMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected