def __init__(self): """Initialize a Core instance. .. note:: [*] Tightly coupled, cohesive framework components [*] Order is important + IO decorated so as to abort on any permission errors + Required folders created + All other components are attached to core: shell, db etc... (using ServiceLocator) :return: instance of :class:`owtf.core.Core` :rtype::class:`owtf.core.Core` """ self.register_in_service_locator() # ------------------------ IO decoration ------------------------ # self.file_handler = catch_io_errors(logging.FileHandler) # -------------------- Component attachment -------------------- # self.db = self.get_component("db") self.config = self.get_component("config") self.db_config = self.get_component("db_config") self.error_handler = self.get_component("error_handler") # ----------------------- Directory creation ----------------------- # FileOperations.create_missing_dirs(self.config.get_logs_dir()) self.create_temp_storage_dirs() self.enable_logging() # The following attributes will be initialised later self.tor_process = None
def create_output_dir_target(self, target_url): """Creates output directories for the target URL :param target_url: The target URL :type target_url: `str` :return: None :rtype: None """ FileOperations.create_missing_dirs(self.get_target_dir(target_url))
def InitPluginOutputDir(self, PluginInfo): PluginOutputDir = self.SetConfigPluginOutputDir(PluginInfo) FileOperations.create_missing_dirs(PluginOutputDir) # Create output dir so that scripts can cd to it :) return PluginOutputDir