g 8dZddlZddlmZddlmZddlmZddlm Z dZ dZ d e d e d e fd Z d e fd ZeddZedd ee ee e fffdZde de d efdZde d e fdZedd efdZdS)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) lru_cache)Dict)SqliteDatabase)PleskSdkz/etc/psa/psa.confz/etc/psa/psa.conf.default conf_filekeyreturnct|5}|D]Z}|}|rB|ds-|\}}||kr|ccdddS[ ddddS#1swxYwYdS)z,Get a specified value from Plesk config file#N)openstrip startswithsplit)rrflinekvalues R/opt/imunify360/venv/lib/python3.11/site-packages/imav/migration_utils/revisium.py_psa_getr"s i!A ! !D::<>JJ    D  s % 22)maxsizec tj}|sJtj|d}tj|sJn#t $rYdSwxYw|S)Nzra.db)rcontext__get_var_dirospathjoinexistsr) revisium_dirrevisium_db_paths rfind_revisium_dbr';s~466 |7<< g>>w~~.////// tt sAA A)(A)c(tjS)zRetrieve all domains from Plesk)rdomain__get_all_domainsrget_all_domainsr,Is  + - --r+ domain_idpermission_namec,tj||S)z4 Retrieve the status of a domain permission )rdomain__has_permission)r-r.s rget_permission_statusr1Os  *9o F FFr+c6t|dS)N document_root)r,)r-s rget_domain_docrootr4Vs   Y ' 88r+c@t}t|}|S)N)r'r)db_pathdbs rget_revisium_dbr8Zs  G  B Ir+)__doc__r! functoolsrtypingrpeeweerimav.migration_utils.plesk_sdkrrrstrrrr'r,boolr1r4r8r*r+rr@s* !!!!!!333333" 2!!#!#!!!!      1    1.c4S>12.... GSG3G4GGGG9#9#9999 1r+