§ À•¿jô|ãóR—ddlmZddlmZddlmZddlZddlZddlZddlZddl Z ddl m Z m Z ddl m Z ddlmZddlZddlmZddlmZdd lmZdd lmZmZdd lmZmZmZdd lmZdd l m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddlm'Z'm(Z(ddlm)Z)ddlm*Z*Gd„de*e e+¦«¦«Z,dS)é)Úabsolute_import)Úprint_function)ÚdivisionN)ÚABCMetaÚabstractmethod)Údatetime©Ú iteritems)Úunicode)ÚClPwd)Úget_file_linesÚwrite_file_lines)Ú pretty_jsonÚdelete_using_realpath_keysÚ get_abs_rel)ÚClSelectExcept)ÚBaseSelectorErrorÚAbsentFileErrorÚMissingVirtualenvErrorÚMissingAppRootErroré)ÚBaseSelectorManager)Úfile_readlinesÚfile_writelines)Úget_using_realpath_keys)Úwith_metaclasscóL—eZdZdZdZdZdZdZdZd„Z e d„¦«Z d„Z d„Z d„Zd'd „Zed(d „¦«Zd „Zeed „¦«¦«Zd(d„Zd(d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"ed„¦«Z#d(d„Z$d(d„Z%d„Z&d „Z'd!„Z(d(d"„Z)d)d$„Z*d%„Z+d&„Z,dS)*ÚBaseApplicationsManagerz[ Base class that responsible for gathering and set information about applications. Nz/var/log/selectorctl.logcó:—||_t¦«|_dS©N)Ú_managerr Ú_pwd)ÚselfÚmanagers úY/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/baseclselect/apps_manager.pyÚ__init__z BaseApplicationsManager.__init__4s€ØˆŒ Ý‘G”GˆŒ ˆ ˆ ócó¾— tj¦« d¦«}t|j|›d|›d�gd¦«dS#t t f$rYdSwxYw)zi Writes string to log file :param log_str: String to write :return: None z%Y-%m-%d %H:%M:%Sú: ú ÚaN)rÚnowÚstrftimerÚ_LOG_FILE_NAMEÚIOErrorÚOSError)ÚclsÚlog_strÚ dt_strings r%Úwrite_string_to_logz+BaseApplicationsManager.write_string_to_log8st€ð Ý œ ™œ×/Ò/Ð0CÑDÔDˆIÝ ˜SÔ/À À À È7È7È7Ð2SÐ1TÐVYÑ ZÔ ZÐ ZÐ ZÐ ZøÝ�Ð!ð ð ð Ø ˆDˆDð øøøs‚AAÁAÁAcóf—| |¦«}|||<| ||¦«dS)a Add data to user's config (update info for an app with app_directory specified) :param str user: name of unix user :param str app_directory: Application root directory :param dict app_data: Application data :return: None N)Úget_user_config_dataÚwrite_full_user_config_data)r#ÚuserÚ app_directoryÚapp_dataÚ current_dicts r%Úadd_app_to_configz)BaseApplicationsManager.add_app_to_configEs=€ð×0Ò0°Ñ6Ô6ˆ Ø&.ˆ �]Ñ#à ×(Ò(¨¨|Ñ<Ô<Ð<Ð<ÐzEBaseApplicationsManager.add_env_vars_for_htaccess..as€ÐJÐJÐJ˜dÀTÐJ�TÐJÐJÐJr'r*rzú ÚzSetEnv {0} {1}z Úw) Úget_htaccess_by_appdirÚopenÚreadÚsplitÚindexÚappendÚitemsÚreplaceÚformatÚwriteÚjoin)r#Ú user_namer9Úenv_varsÚdoc_rootÚenv_section_beginÚenv_section_endÚ htaccess_fileÚhtaccessÚlinesÚstartÚendÚenv_varÚvalues r%Úadd_env_vars_for_htaccessz1BaseApplicationsManager.add_env_vars_for_htaccessRs€€ðaÐØ\ˆØ×3Ò3°I¸}ÈhÐX\Ñ]Ô]ˆ Ø Ð Ø ˆFÝ �- Ð->Ð ?Ñ ?Ô ?ð .À8ØJÐJ h§m¢m¡o¤o×&;Ò&;¸DÑ&AÔ&AÐJÑJÔJˆEØ  EÐ)Ð)¨oÀÐ.FÐ.FØŸ š Ð$5Ñ6Ô6�Ø—k’k /Ñ2Ô2�ؘ%  q¡˜.Ð)ØÐ#Ø— ’ Ð.Ñ/Ô/Ð/Ø— ’ Ð3Ñ4Ô4Ð4Ø&.§n¢nÑ&6Ô&6ðJðJ‘N�G˜UØ%Ÿošo¨d°BÑ7Ô7×?Ò?ÀÀbÑIÔI�GØ!ŸMšM¨$°Ñ3Ô3×;Ò;¸DÀ"ÑEÔE�EØ—L’LÐ!1×!8Ò!8¸À%Ñ!HÔ!HÑIÔIÐIÐIØ— ’ ˜]Ñ+Ô+Ð+Ø— ’ ˜_Ñ-Ô-Ð-ð .ð .ð .ñ .ô .ð .ð .ð .ð .ð .ð .øøøð .ð .ð .ð .õ�- Ð->Ð ?Ñ ?Ô ?ð -À8Ø �NŠN˜4Ÿ9š9 UÑ+Ô+Ñ ,Ô ,Ð ,ð -ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð -ð -s$³EFÆFÆFÆ5)G+Ç+G/Ç2G/có¢—| |¦«} t|||¦«| ||¦«dS#t$rYdSwxYw)zß Removes application from config :param user: User name :param app_dir: Application directory :return: True if app is exists in config, False - if app is not exists in config TF)r6rr7ÚKeyError)r#r8Úapp_dirÚ config_datas r%Úremove_app_from_configz.BaseApplicationsManager.remove_app_from_configrso€ð×/Ò/°Ñ5Ô5ˆ ð Ý & t¨W°kÑ BÔ BÐ Bà × ,Ò ,¨T°;Ñ ?Ô ?Ð ?ð�4øõð ð ð Ø�5�5ð øøøs—'AÁ AÁ AFc ó”—| |¦«}|sdSt|¦«D]ˆ\}}|rtjd|z|d¦«}ntjd|z|d¦«}|�Bt d |ddt |¦« …|¦«¦«|d<Œ‰| ||¦«dS)a Replace domain in config files when it is renamed. :param username: domain owner :param domain: previous name :param new_domain: name after rename :param include_subdomains: whether we should also rename subdomains :return: Nz (\.|^)%s$Údomainz^%s$z{}{})r6r ÚreÚsearchr rRÚlenr7) r#ÚusernamerhÚ new_domainÚinclude_subdomainsÚ full_configÚappÚconfigÚmatchs r%Úreplace_domain_in_configsz1BaseApplicationsManager.replace_domain_in_configs„sç€ð×/Ò/°Ñ9Ô9ˆ Øð Ø ˆFõ% [Ñ1Ô1ð !ð !‰KˆC�Ø!ð FÝœ  ,°Ñ"7¸ÀÔ9IÑJÔJ��åœ  '¨FÑ"2°F¸8Ô4DÑEÔE�àÐ Ý#*¨6¯=ª=à˜8Ô$ ]¥s¨6¡{¤{ l ]Ô3Øñ, ô, ñ$!ô$!��xÑ øð ×(Ò(¨°;Ñ?Ô?Ð?Ð?Ð?r'cóF‡—t||¦«\Š}ˆfd„|D¦«S)z6 Return list of detected config files cóŽ•—g|]A}tj tj ‰|¦«¦«¯?|‘ŒBSrC)ÚosÚpathÚexistsrT)rDrqÚabs_paths €r%rFz>BaseApplicationsManager._find_config_files..¦s=ø€Ð`Ð`Ð`˜6µ´·²ÅÄÇ Â ÈXÐW]Ñ@^Ô@^Ñ1_Ô1_Ð`�Ð`Ð`Ð`r')r)rUr9ÚpatternsÚrel_pathrys @r%Ú_find_config_filesz*BaseApplicationsManager._find_config_filesŸs3ø€õ )¨°MÑBÔBш�(Ø`Ð`Ð`Ð` XÐ`Ñ`Ô`Ð`r'c óì—| ||¦«}|j |¦«}| ||||¦«}d t j¦«d tj  ||¦«¦«d |d¦«g}|  |  |  |||¦«|¦«¦«|  dd¦«}|r| d|z¦«| t jdz¦«|  t!|d ¬ ¦«¦«t j|¦«} tj|d ¬ ¦«} t%j| j¦«rt%j| j¦«nd } n#t,$rd } YnwxYwtj|tjtjztjztjztjz| ¦«} tj| dd ¬ ¦«5} |  |¦«ddd¦«dS#1swxYwYdS)zý Creates .htaccess file for application based on application config data :param str user_name: User's name :param str app_root: Application root :param doc_root: Document root for the domain :return: None z{} zPassengerAppRoot "{}" zPassengerBaseURI "/{}" Úapp_uriÚpassenger_log_fileNzPassengerAppLogFile "%s" r*r?r@F)Úfollow_symlinksi¤rI)Úget_app_configr"Ú get_homedirrJrRÚ clpassengerÚHTACCESS_BEGINrvrwrTÚextendÚ(get_interpreter_specific_passenger_linesÚget_binary_pathÚgetrOÚ HTACCESS_ENDrÚrm_double_empty_linesÚstatÚS_ISREGÚst_modeÚS_IMODEÚFileNotFoundErrorrKÚO_WRONLYÚO_CREATÚO_TRUNCÚ O_NOFOLLOWÚ O_CLOEXECÚfdopenÚ writelines) r#rUÚapp_rootrWÚ app_configÚuser_dirrZÚ new_linesrÚsrc_stÚ keep_modeÚfdÚfs r%Úupdate_htaccess_filez,BaseApplicationsManager.update_htaccess_file¨s–€ð$×(Ò(¨°HÑ=Ô=ˆ Ø”9×(Ò(¨Ñ3Ô3ˆØ×3Ò3°I¸xÈÐS]Ñ^Ô^ˆ à �MŠM�+Ô4Ñ 5Ô 5Ø %× ,Ò ,­R¬W¯\ª\¸(ÀHÑ-MÔ-MÑ NÔ NØ &× -Ò -¨j¸Ô.CÑ DÔ Dð ˆ ð ×Ò˜×FÒFØ × Ò  ¨H°hÑ ?Ô ?Ø ñôñ ô ð ð(Ÿ^š^Ð,@À$ÑGÔGÐØ ð PØ × Ò Ð9ÐOÐPÑPÔPÑQÔQÐQÝÔ5°iÑ@Ô@ˆ ð Ý”W˜]¸EÐBÑBÔBˆFÝ8<¼ ÀVÄ^Ñ8TÔ8TÐ_�œ  V¤^Ñ4Ô4Ð4ÐZ_ˆIˆIøÝ ð ð ð ØˆIˆIˆIð øøøå ŒW�]Ý”[¥2¤:Ñ-µ´ Ñ:Ý”}ñ%Ý')¤|ñ4àñ ô ˆõŒY�r˜3Ð'8Ð 9Ñ 9Ô 9ð $¸QØ �LŠL˜Ñ #Ô #Ð #ð $ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $ð $ð $s%Å>A G Ç GÇGÉI)É)I-É0I-có—t‚)zu Return list of lines that needs to be added to htaccess and are specific to the interpreter )ÚNotImplementedError)Ú binary_pathr˜s r%r†z@BaseApplicationsManager.get_interpreter_specific_passenger_linesßs €õ"Ð!r'có’—| ||¦«}|€|j}tj ||j||d|¦«S)a­ Return a path to the environment's interpreter binary Get interpreter path for application :param user: owner of the application :param app_root: app path relative to user home (app-root) :param user_dir: User's home directory :param binary_name: name of binary in virtual environemnt (python, npm, node) :return: path to interpreter binary in virtual environment NÚbin)Úget_interpreter_version_for_appÚ BINARY_NAMErvrwrTÚVENV_DIR)r#r8r—r™Ú binary_nameÚversions r%r‡z'BaseApplicationsManager.get_binary_pathèsG€ð×6Ò6°t¸XÑFÔFˆØ Ð ØÔ*ˆKÝŒw�|Š|˜H d¤m°X¸wÈÈ{Ñ[Ô[Ð[r'cóp—|€|j ¦«S||j |¦«iS)zÇ Retrives info about user(s). :param str | None username: Username to retrive information. :return: Dictionary with user info. Example: {'user1': pw_struct} )r"Ú get_user_dictÚget_pw_by_name)r#rls r%Úget_users_dictz&BaseApplicationsManager.get_users_dict÷s9€ð Ð Ø”9×*Ò*Ñ,Ô,Ð ,ؘ$œ)×2Ò2°8Ñ<Ô<Ð=Ð=r'có*—i}| |¦«}tj |¦«rÜtj¦«dkrJ|j |¦«}dt_tj ||j |j dd¬¦«}nt|¦«} tjd |pg¦«¦«}nA#t t"f$r-t%jd |j¦«¦«‚wxYw|S)z” Get all data from user's config :param user: name of unix user :return: json data from user's config as dictionary rTF©Ú exit_on_errorÚ write_logrHzUser config "{}" is broken)Ú_get_path_to_user_configrvrwÚisfileÚgeteuidr"r¬ÚsecureioÚ SILENT_FLAGÚread_file_secureÚpw_uidÚpw_gidr ÚjsonÚloadsrTÚ ValueErrorÚ TypeErrorrÚ WrongDatarRÚ _USER_CONFIG)r#r8Ú_user_config_dataÚ user_configÚuser_pwÚdatas r%r6z,BaseApplicationsManager.get_user_config_datas€ð ÐØ×3Ò3°DÑ9Ô9ˆ õ Œ7�>Š>˜+Ñ &Ô &ð gÝŒz‰|Œ|˜qÒ Ð Øœ)×2Ò2°4Ñ8Ô8�Ø'+•Ô$õ  Ô0°¸g¼nÈgÌnØ?DÐPUðWñWôW��õ& kÑ2Ô2�ð gÝ$(¤J¨r¯wªw°t°z¸rÑ/BÔ/BÑ$CÔ$CÐ!Ð!øÝ¥ Ð*ð gð gð gÝ$Ô.Ð/K×/RÒ/RÐSWÔSdÑ/eÔ/eÑfÔfÐfð gøøøà Ð s Â()CÃ>Dcór—| |¦«} t|||¦«S#t$rYdSwxYw)zê Retrieves full application config :param user: User name :param app_dir: Application directory :return: Application data as dictionary If None - No application data found in config N)r6rrc)r#r8rdÚuser_config_datas r%r�z&BaseApplicationsManager.get_app_config#sR€ð ×4Ò4°TÑ:Ô:Ðð Ý*¨4°Ð:JÑKÔKÐ KøÝð ð ð Ø�4�4ð øøøs —(¨ 6µ6có>—| ||¦«}|dS)zÆ Retrieves domain for provided user's application :param username: user name :param app_directory: application root directory :return str: application domain rh©r�)r#rlr9r˜s r%Úget_app_domainz&BaseApplicationsManager.get_app_domain1s$€ð×(Ò(¨°=ÑAÔAˆ ؘ(Ô#Ð#r'có>—| ||¦«}|dS)zÀ Retrieves uri for provided user's application :param username: user name :param app_directory: application root directory :return str: application uri r~rÇ©r#rlr9r:s r%Ú get_app_uriz#BaseApplicationsManager.get_app_uri;s$€ð×&Ò& x°Ñ?Ô?ˆØ˜ Ô"Ð"r'có>—| ||¦«}|dS)zå Retrieves name of startup file for provided user's application :param username: user name :param app_directory: application root directory :return str: name of startup file of application Ú startup_filerÇrÊs r%Úget_app_startup_filez,BaseApplicationsManager.get_app_startup_fileEs$€ð×&Ò& x°Ñ?Ô?ˆØ˜Ô'Ð'r'có>—| ||¦«}|dS)zË Retrieves status for provided user's app_directory :param username: user name :param app_directory: application root directory :return str: status of application Ú app_statusrÇrÊs r%Úget_app_statusz&BaseApplicationsManager.get_app_statusOs$€ð×&Ò& x°Ñ?Ô?ˆØ˜ Ô%Ð%r'có —| ||¦«}|€'tjd |¦«¦«‚|d|jzS)zÜ Retrieves interpreter version for provided user and application :param username: user name :param app_directory: application root directory :return str: major interpreter version Nz)Application config is missed for user: {}ú %s_version)r�rÚConfigMissingErrorrRÚ INTERPRETERrÊs r%r¥z7BaseApplicationsManager.get_interpreter_version_for_appYs]€ð×&Ò& x°Ñ?Ô?ˆØ Ð Ý Ô3ð5CßCIÂ6È(ÑCSÔCSñUôUð Uà˜  tÔ'7Ñ7Ô8Ð8r'có„—|j |¦«}tj ||j¦«}|S)z� Get full path to user config ~/${_USER_CONFIG} :param username: name of unix user :return: full path to config )r"r‚rvrwrTr¿)r#rlÚ user_homeÚapplication_configs r%r²z0BaseApplicationsManager._get_path_to_user_configfs8€ð ”I×)Ò)¨(Ñ3Ô3ˆ ÝœWŸ\š\¨)°TÔ5FÑGÔGÐà!Ð!r'cóT—|jj |¦«}||kr|SdS)zŠ Retrieves full version for supplied major version. :return: str - Full version or None if full version not found N)r!ÚpkgÚget_full_version)r#Ú major_versionÚ full_versions r%Ú_get_full_version_for_shortz3BaseApplicationsManager._get_full_version_for_shortqs2€ð ”}Ô(×9Ò9¸-ÑHÔHˆ Ø ˜=Ò (Ð (ØÐ ؈tr'cót—|j|vr|||jd|<dS|j||idœ}|||j<dS)a@ Add single application data to user_data_dest_dict :param users_data_dest_dict: Destination dictionary with application data :param user_pw_entry: User's passwd entry :param app_root_dir: Application root directory :param app_data: Application data :return: None Ú applications)ÚhomedirràN)Úpw_nameÚpw_dir)r#Úusers_data_dest_dictÚ user_pw_entryÚ app_root_dirr:Ú user_datas r%Ú_add_single_user_appz,BaseApplicationsManager._add_single_user_app{sd€ð Ô Ð$8Ð 8Ð 8àX`Ð  Ô!6Ô 7¸Ô GÈ Ñ UÐ UÐ Uð)Ô/Ø!-¨xÐ 8ððˆIð;DÐ  Ô!6Ñ 7Ð 7Ð 7r'có�—| |j|¦«}t|d|z¦«}t|¦«|d<dS)zÔ&>ð Yð YÑ "ˆL˜(õ˜h­Ñ-Ô-ð °ÀHÐ1LÐ1LØØ'+×'GÒ'GÈÐQ\ÔH]Ñ'^Ô'^Ð $Ø'Ð/Ð3KÐSfÐ3fÐ3fðàÐ1Ð2JÔKÐKÐKØIKÐ#Ð$<Ô=¸gÑFð  ×!5Ò!5Ø!Ô)¨<¸Ô9MØ *ð"6ñ",ô",ð&ˆH�\Ñ "ð ˜Ð%Ø,Ð-EÔFÀwÔOˆJØ × :Ò :¸8À\ÐS`Ñ aÔ aÐ aØ × %Ò % j°-ÀÈxÑ XÔ XÐ XÐ Xð7 Yð Yr'cóL—t|¦«D]\}}d|vrd|d<|||<Œ|S)z× Append absent 'passenger_log_file' key with None value to each application :param user_config_dict: Sourse dictionary to modify :return: Modified dict with 'passenger_log_file' keys rNr )Úuser_config_dictr—r:s r%Ú_add_absent_passenger_log_filez6BaseApplicationsManager._add_absent_passenger_log_file»sK€õ#,Ð,<Ñ"=Ô"=ð 2ð 2Ñ ˆH�hØ#¨8Ð3Ð3Ø15�Ð-Ñ.Ø)1Ð ˜XÑ &Ð &ØÐr'cóL—|€tj¦«}tj ||j¦«}tj |¦«st |¦«‚ |dkr&dt_tj |||dd¬¦«}nt|¦«}|  tj d |¦«¦«¦«S#ttt t"f$r'}t%d|t'|¦«dœd œ¦«‚d}~wwxYw) a] Read [python|ruby|node]-selector.json file from user's directory. :param euid: current effective uid :param user_homedir: user's home directory :param uid: uid for drop rights :param gid: gid for drop rights :return: Cortege contents_dict. None - there is no [python|ruby|node]-selector.json file in user's directory :raises BaseSelectorError if error. Exception contents: {'message': "File %(file)s read/parse error: %(error)s", 'context': {'file': node_json_path, 'error': 'some message'}} NrTFr¯rHz)File %(file)s read/parse error: %(error)s)ÚfileÚerror)ÚmessageÚcontext)rvr´rwrTr¿rxrrµr¶r·r rÿrºr»r/r0r½r¼rÚstr)r#Ú user_homedirÚuidÚgidÚeuidÚjson_config_pathÚ file_linesÚes r%Úread_user_selector_config_jsonz6BaseApplicationsManager.read_user_selector_config_jsonÈs+€ð ˆ<Ý”:‘<”<ˆDåœ7Ÿ<š<¨ °dÔ6GÑHÔHÐÝŒw�~Š~Ð.Ñ/Ô/ð 4Ý!Ð"2Ñ3Ô3Ð 3ð ^Ø�qŠyˆyð(,•Ô$Ý%Ô6Ð7GÈÈcÐafÐrwÐxÑxÔx� � õ,Ð,<Ñ=Ô=� Ø×6Ò6µt´zÀ"Ç'Â'È*ÑBUÔBUÑ7VÔ7VÑWÔWÐ WøÝ�¥)­ZÐ8ð ^ð ^ð ^å#Ð0[Ø9IÕTWÐXYÑTZÔTZÐ0[Ð0[ð%]ð%]ñ^ô^ð ^øøøøð ^øøøsÁ*A4CÃD#Ã<"DÄD#có¤— |€| ||¦«}tj ||dd¦«S#t$rYdSwxYw)a  Retrieve .htaccess for user and app :param user: Username :param app_dir: App dir :param doc_root: Document root for selected domain :param app_config: Optional app configuration :return: .htaccess full path Nr~z .htaccess)r�rvrwrTrc)r#r8rdrWr˜s r%rJz.BaseApplicationsManager.get_htaccess_by_appdirêsa€ð ØÐ!Ø!×0Ò0°°wÑ?Ô?� Ý”7—<’< ¨*°YÔ*?ÀÑMÔMÐ MøÝð ð ð Ø�4�4ð øøøs‚>AÁ AÁAcó®—| |¦«} t|||¦«}||d<n#t$rYdSwxYw| ||¦«dS)zà Retrieves application status :param user: User name :param app_dir: Application directory :param new_status: New appication status :type new_status: str :return: None rÐN)r6rrcr7)r#r8rdÚ new_statusrÅr˜s r%Úset_app_statusz&BaseApplicationsManager.set_app_statusús}€ð ×4Ò4°TÑ:Ô:Ðð Ý0°°wÐ@PÑQÔQˆJØ'1ˆJ�|Ñ $Ð $øÝð ð ð Ø ˆFˆFð øøøð ×(Ò(¨Ð/?Ñ@Ô@Ð@Ð@Ð@s —.® <»<có’—| |¦«}tj¦«dkstj¦«dkrt jd¦«‚t |¦«} tj||dd¬¦«dS#tttf$r-}t j |d  |¦«¦«‚d}~wwxYw)zš Write data to user's config :param user: name of unix user :param config_data: data in json format :return: None rz$root should not write to user configi€Ú_tmp)ÚcontentÚ dest_pathÚpermÚsuffixz%Could not write json user config ({})N)r²rvr´ÚgetegidrÚSelectorExceptionrrµÚwrite_file_via_tempfiler/r0r½ÚUnableToSaveDatarR)r#r8rer Ú dumped_datar s r%r7z3BaseApplicationsManager.write_full_user_config_data sî€ð ×8Ò8¸Ñ>Ô>Ðå Œ:‰<Œ<˜1Ò Ð ¥¤ ¡ ¤ °Ò 1Ð 1Ý Ô2Ø6ñ8ô8ð 8å! +Ñ.Ô.ˆ ð Cõ Ô ,Ø#Ø*ØØð  ñ ô ð ð ð øõ �¥)Ð,ð Cð Cð CÝ Ô1Ø Ø7×>Ò>¸qÑAÔAñCôCð Cøøøøð CøøøsÁ(BÂCÂ(CÃCcóª—| ¦«}t|¦«D]®\}} | |j|j|j¦«}|�<| ¦«D]'}| d|jz¦«|krdSŒ(Œk#t$rYŒwt$r,}|  |j |j z¦«Yd}~Œ§d}~wwxYwdS)zâ Returns True if specified NodeJS version is in use by any app of any user. It will stop search on the first match. :param version: NodeJS interpreter major version :return True | False NrÓTF)r­r r rãr¸r¹ÚvaluesrˆrÕrrr4rr)r#r©Ú user_inforUråÚuser_apps_datarpr s r%Úis_version_in_usez)BaseApplicationsManager.is_version_in_use,s€ð×'Ò'Ñ)Ô)ˆ å(1°)Ñ(<Ô(<ð @ð @Ñ $ˆI�}ð @à!%×!DÒ!DÀ]ÔEYÐ[hÔ[oØERÔEYñ"[ô"[�à!Ð-Ø-×4Ò4Ñ6Ô6ð(ð(˜ØŸ7š7 <°$Ô2BÑ#BÑCÔCÀwÒNÐNØ#' 4 4 4ðOøøå"ð ð ð ð�Ý$ð @ð @ð @Ø×(Ò(¨¬°Q´YÑ)>Ñ?Ô?Ð?Ð?Ð?Ð?Ð?Ð?øøøøð @øøøàˆus$ªA B B C CÂ$"C à Cc ó —tj¦«dkr*tjtj¦«¦«j} | |¦«}n,#t jj$rtj |¦«‚wxYw|  ¦«}|d}t|¦«D�]\}} |  |j|j|j¦«}| |||¦«ŒE#t$$rYŒQt&$r\}tj¦«dkr9| |j|jz¦«d|j›d|j›d�|d<n|‚Yd}~Œ±d}~wt2$r]}tj¦«dkr:| d|j›d |›d |›�¦«d|j›d|j›d�|d<n‚Yd}~�Œd}~wwxYw|S) aã Retrieves info about all installed NodeJS interpreters and user(s) applictions :param user: User name for read applictions. If None and current euid == 0 - all users will be processed. If current euid != 0 (called under some user), this argument will be ignored and only user with uid == euid will be processed :return: Dictionary with user(s) applications info :raises ClSelectExcept.NoSuchUser or BaseSelectorError rÚavailable_versionsz Some user's zD can't be read. Some user(s) data absent in output. Please see file z for detailsÚwarningNzFailed to process z for user r))rvr´Ú_stdpwdÚgetpwuidrâr­rµÚclpwdÚNoSuchUserExceptionrÚ NoSuchUserÚ_get_interpreter_infor r rãr¸r¹rürrr4rrr¿r.Ú Exception) r#r8rÚusers_apps_infor#rUrår r s r%Úget_applications_users_infoz3BaseApplicationsManager.get_applications_users_infoGsX€õ, Œ:‰<Œ<˜1Ò Ð ÝÔ#¥B¤J¡L¤LÑ1Ô1Ô9ˆDð 2Ø×+Ò+¨DÑ1Ô1ˆIˆIøÝŒ~Ô1ð 2ð 2ð 2Ý Ô+¨DÑ1Ô1Ð 1ð 2øøøà×4Ò4Ñ6Ô6ˆØ,Ð-AÔBÐõ)2°)Ñ(<Ô(<ð( ñ( Ñ $ˆI�}ð' à!%×!DÒ!DÀ]ÔEYÐ[hÔ[oØERÔEYñ"[ô"[�ð×'Ò'¨ Ð7IÈ>ÑZÔZÐZÐZøÝ"ð ð ð ð�Ý$ð ð ð å”:‘<”< 1Ò$Ð$ð×,Ò,¨Q¬Y¸¼Ñ-BÑCÔCÐCÐCð37Ô2CÐ2CÐ2CÀTÔEXÐEXÐEXð2Z�O IÑ.Ð.ð �Gð /Ð.Ð.Ð.Ð.øøøøõ ð ð ð õ”:‘<”< 1Ò$Ð$Ø×,Ò,Ð,à Ô-Ð-Ð-¨y¨y¨y¸!¸!ð=ñ>ô>ð>ð>ð 37Ô2CÐ2CÐ2CÀTÔEXÐEXÐEXð2Z�O IÑ.Ð.ðð /Ð.Ð.Ð.Ñ.øøøøð øøøð$Ðs8ÁAÁ)BÂ7=C5Ã5 G Ä G Ä AE!Å! G Å.AGÇG Tcó”—|j |¦«j}tj ||j|¦«}|r.tj |¦«st|¦«‚tj ||¦«}|r.tj |¦«st|¦«‚||fS)a Calculate, check exists and return application folders This method does not check that application exists in config. :raises: NoSuchUserException, MissingVirtualenvError, MissingAppRootError :return: tuple(app_root, app_venv) with absolute paths ) r"r¬rãrvrwrTr§rxrr)r#rlr—Úchk_envÚ chk_app_rootr×Úapp_venvs r%Úget_app_foldersz'BaseApplicationsManager.get_app_folders’s«€ð”I×,Ò,¨XÑ6Ô6Ô=ˆ Ý”7—<’<  ¨4¬=¸(ÑCÔCˆØ ð 3�2œ7Ÿ>š>¨(Ñ3Ô3ð 3Ý(¨Ñ2Ô2Ð 2å”7—<’<  ¨8Ñ4Ô4ˆØ ð 0¥¤§¢¨xÑ 8Ô 8ð 0Ý% hÑ/Ô/Ð /à˜Ð!Ð!r'có8—|j ¦«}|S)z)Get initial information about interpreter)r!Ú get_summary)r#r,s r%r*z-BaseApplicationsManager._get_interpreter_info¤s€àœ-×3Ò3Ñ5Ô5ˆØÐr'có@—|jj |¦«S)zi Just a public proxy to internal method that blocks any actions with interpreter )r!rÚÚacquire_interpreter_lock)r#Ú it_versions r%r6z0BaseApplicationsManager.acquire_interpreter_lock©s€ð Œ}Ô ×9Ò9¸*ÑEÔEÐEr')Fr )TT)-Ú__name__Ú __module__Ú __qualname__Ú__doc__r¿r.rÕr§r¦r&Ú classmethodr4r<rarfrsÚ staticmethodr|rŸrr†r‡r­r6r�rÈrËrÎrÑr¥r²rÞrèrïrürÿr rJrr7r!r-r2r*r6rCr'r%rr(s¶€€€€€ððð €LØ/€NØ€KØ€HØ€Kððððð ð ñ„[ð ð =ð =ð =ð-ð-ð-ð@ððð$@ð@ð@ð@ð6ðaðaðañ„\ðað5$ð5$ð5$ðnØð"ð"ñ„^ñ„\ð"ð \ð \ð \ð \ð >ð >ð >ð >ð!ð!ð!ðB ð ð ð$ð$ð$ð#ð#ð#ð(ð(ð(ð&ð&ð&ð 9ð 9ð 9ð "ð "ð "ððððDðDðDð(6ð6ð6ð $Yð$Yð$YðLð  ð  ñ„\ð  ð ^ð ^ð ^ð ^ðDðððð AðAðAð$CðCðCð@ððð6IðIðIðIðV"ð"ð"ð"ð$ððð FðFðFðFðFr'r)-Ú __future__rrrrºrvÚpwdr%rir‹ÚabcrrrÚclselect.clpassengerrƒrµÚ future.utilsr Ú past.builtinsr Úclcommonr Úclcommon.utilsr rÚclselect.utilsrrrÚclselectrÚclselect.baseclselectrrrrÚselector_managerrrrrrÚobjectrrCr'r%úrKsðð'Ð&Ð&Ð&Ð&Ð&Ø%Ð%Ð%Ð%Ð%Ð%ØÐÐÐÐÐØ € € € Ø € € € ØÐÐÐØ € € € Ø € € € Ø'Ð'Ð'Ð'Ð'Ð'Ð'Ð'ØÐÐÐÐÐà*Ð*Ð*Ð*Ð*Ð*Ø€€€Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!àÐÐÐÐÐØ;Ð;Ð;Ð;Ð;Ð;Ð;Ð;ØOÐOÐOÐOÐOÐOÐOÐOÐOÐOØ#Ð#Ð#Ð#Ð#Ð#ððððððððððððð 2Ð1Ð1Ð1Ð1Ð1Ø:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ø2Ð2Ð2Ð2Ð2Ð2Ø'Ð'Ð'Ð'Ð'Ð'ðF FðF FðF FðF FðF F˜n˜n¨W°fÑ=Ô=ñF FôF FðF FðF FðF Fr'