processor function will be called as a new thread and will be die when kill_flag is True :return:
(self)
| 26 | os.makedirs(self.DIRECTORY_TO_WATCH) |
| 27 | |
| 28 | def processor(self): |
| 29 | """ |
| 30 | processor function will be called as a new thread and will be die when |
| 31 | kill_flag is True |
| 32 | :return: |
| 33 | """ |
| 34 | new_file_handler = FileMonitor() |
| 35 | new_file_handler.log_filename = self.log_filename |
| 36 | new_file_handler.log_filename_dump = self.log_filename_dump |
| 37 | new_file_handler.DIRECTORY_TO_WATCH = self.DIRECTORY_TO_WATCH |
| 38 | new_file_handler.EXCLUDES = self.EXCLUDES |
| 39 | new_file_handler.module_name = self.module_name |
| 40 | thread = threading.Thread(target=new_file_handler.run, args=(), name="ftp_weak_password_processor") |
| 41 | if os.path.exists(self.log_filename): |
| 42 | os.remove(self.log_filename) # remove if exist from past |
| 43 | thread.start() # Start the execution |
| 44 | while not self.kill_flag: |
| 45 | try: |
| 46 | time.sleep(0.1) |
| 47 | except Exception: |
| 48 | pass |
| 49 | new_file_handler.stop() |
| 50 | terminate_thread(thread) |
| 51 | |
| 52 | |
| 53 | def module_configuration(): |
nothing calls this directly
no test coverage detected