The run() method, defined on line 61, executes the entire logic of our framework in a few lines of code. Lines 62 through 68 simply print and log startup information for debugging purposes. Notice the use of Figlet on lines 65 and 66 to print our framework's title to the console:
061 def run(self):
062 msg = 'Initializing framework'
063 print('[+]', msg)
064 self.log.info(msg)
065 f = Figlet(font='doom')
066 print(f.renderText('Framework'))
067 self.log.debug('System ' + sys.platform)
068 self.log.debug('Version ' + sys.version)
On lineĀ 69, we check to see whether the output directory exists. If it doesn't, we create it using the os.makedirs() method. Finally, on lines 71 and 72, we call the _list_files() and _run_plugins() methods to index the input directory files and run our plugins against them:
069 if not os.path.exists(self.output):
070 os.makedirs(self.output)
071 self._list_files()
072 self._run_plugins()