gdZddlZddlZddlZddlZddlmZddlmZej e Z dZ dedee fdZd Zd 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)Path)Optionalc#K|dkrtdt|}ttj||x}r*|Vttj||x}(dSdS)Nzn must be at least one) ValueErroritertuple itertoolsislice)iterablenitbatchs O/opt/imunify360/venv/lib/python3.11/site-packages/imav/migration_utils/other.pybatchedr s1uu1222 hB)"a0011 1% )"a0011 1%pathreturnc\ |S#t$r }Yd}~dSd}~wwxYw)N)owner Exception)res r get_ownerr)sAzz|| ttttts  ++c4 ddl}n#t$rYdSwxYwdS)NrFT)im360 ImportError)rs r im360_presentr0s9 uu 4s  ctjfd}tjfd}tjr|n|S)NcxKtrtddS|i|d{VSNz,Imunify360 is already installed. Skipping...rloggerinfoargskwargsfs r async_wrapperz%skip_for_im360..async_wrapper9sR ??  KKF G G G FQ''''''''''rchtrtddS|i|Sr r!r$s rwrapperzskip_for_im360..wrapper@s< ??  KKF G G G Fq$!&!!!r) functoolswrapsinspectiscoroutinefunction)r'r(r*s` rskip_for_im360r/8s}_Q((((( _Q""""" $7:: G==Gr)__doc__r+loggingr-r pathlibrtypingr getLogger__name__r"rstrrrr/rrr8s*  8 $ $DXc]HHHHHr