h dZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ee Zd dZ d d ed ed eeeffd ZdS)u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N) getLogger)Tuple)MalwareScanType)MalwareScanner) BackupRestorec4dtdtffd }|S)NfilesreturncK|sgSg}t}||tjd|d{V}|d|dD}|S)zzE_get_scan_function.._custom_scan_function..0sHHHa nHHHresults)rstartrRESTORE_FROM_BACKUP async_wait)r still_infectedscannerresultr r s r_custom_scan_functionz1_get_scan_function.._custom_scan_function#s I d6::: %9    ))++++++++  HHfY6GHHHNr)list)r r rs`` r_get_scan_functionr!"s=4D ! rr untilr c&Kddlm}tj}|s Jdg|}} t |}||||||d{V\}}n9#t j$rt$rt dYnwxYw||fS)Nr)async_restore_infectedzBackup system is not selected!)backendr r" scan_functmp_dirz Error during restore from backup) restore_infected.restorer$r backup_systemr!asyncioCancelledError Exceptionlogger exception) r r"r r'r$r%restored not_restored scan_functions r restore_filesr26s@?????)++G 444447lH =*400 '='=# ( ( ( " " " " " " ,,  ! ===;<<<<<= \ !!s(A3B  B )N)__doc__r*datetimeloggingrtypingrimav.malwarelib.configrimav.malwarelib.scan.scannerr defence360agent.contracts.configr__name__r-r!r r2rrrr;s*222222777777:::::: 8  !!!!*15"" " " 4:""""""r