sltxpkg/dep.py
def extend_grab_from_local(idx: str, driver_target_dir: str, data: dict) -> Tuple[list, list]:
    """May install extra profiles

       This method will check for a local dep file, and if present
       check for a profiles key. if present it will check for a selected profile in the data dict.
       If so, select it, if none, set the default
    Args:
        idx (str): index to use in multithreading
        driver_target_dir (str): target dir of the current driver
        data (str): data dict for local configuration
    Returns:
        (list,list) - a list of additional dependencies in the format 'files, folder'
    """
    if 'dep' not in data:
        dep = sg.DEFAULT_DEPENDENCY
    else:
        dep = data['dep']
    dep_files = glob.glob(os.path.join(driver_target_dir, dep), recursive=True)
    if len(dep_files) <= 0:
        return [], []

    # load file and check for default
    # TODO: avoid reloading if recursive?
    file_profiles = {}
    for dep_file in dep_files:
        file_profiles = load_dependencies_config(dep_file, file_profiles)

    if 'profiles' not in file_profiles:
        return [], []

    file_profiles = file_profiles['profiles']
    # Note: I do want always a default profile so it makes live easier for me
    if 'default' not in file_profiles:
        raise DependencyProfileException(
            'No default profile for enlisted profiles. Found: ' + str(file_profiles))
    if 'profile' in data:
        requested_profile = data['profile']
        if requested_profile not in file_profiles:
            raise DependencyProfileException('Requested profile (' + requested_profile + ') not found. Found: ' +
                                             str(file_profiles))
    else:
        requested_profile = 'default'
    added_profiles: dict = file_profiles[requested_profile]
    print_idx(idx, ' > Loaded profile (' +
              requested_profile + '): ' + str(added_profiles))
    # TODO: this may be beautified
    grab_files = added_profiles['grab-files'] if 'grab-files' in added_profiles else ""
    grab_dirs = added_profiles['grab_dirs'] if 'grab_dirs' in added_profiles else ""
    return grab_files, grab_dirs
May install extra profiles

       This method will check for a local dep file, and if present
       check for a profiles key. if present it will check for a selected profile in the data dict.
       If so, select it, if none, set the default
    Args:
        idx (str): index to use in multithreading
        driver_target_dir (str): target dir of the current driver
        data (str): data dict for local configuration
    Returns:
        (list,list) - a list of additional dependencies in the format 'files, folder'
    
May install extra profiles
This method will check for a local dep file, and if present
check for a profiles key. if present it will check for a selected profile in the data dict.
If so, select it, if none, set the default
May install extra profiles This method will check for a local dep file and if present check for a profiles key . if present it will check for a selected profile in the data dict . If so select it if none set the default
def extend_grab_from_local(idx: str, driver_target_dir: str, data: dict) -> Tuple[list, list]:
    if 'dep' not in data:
        dep = sg.DEFAULT_DEPENDENCY
    else:
        dep = data['dep']
    dep_files = glob.glob(os.path.join(driver_target_dir, dep), recursive=True)
    if len(dep_files) <= 0:
        return [], []
    file_profiles = {}
    for dep_file in dep_files:
        file_profiles = load_dependencies_config(dep_file, file_profiles)
    if 'profiles' not in file_profiles:
        return [], []
    file_profiles = file_profiles['profiles']
    if 'default' not in file_profiles:
        raise DependencyProfileException(
            'No default profile for enlisted profiles. Found: ' + str(file_profiles))
    if 'profile' in data:
        requested_profile = data['profile']
        if requested_profile not in file_profiles:
            raise DependencyProfileException('Requested profile (' + requested_profile + ') not found. Found: ' +
                                             str(file_profiles))
    else:
        requested_profile = 'default'
    added_profiles: dict = file_profiles[requested_profile]
    print_idx(idx, ' > Loaded profile (' +
              requested_profile + '): ' + str(added_profiles))
    grab_files = added_profiles['grab-files'] if 'grab-files' in added_profiles else ""
    grab_dirs = added_profiles['grab_dirs'] if 'grab_dirs' in added_profiles else ""
    return grab_files, grab_dirs
def extend_grab_from_local ( idx : str , driver_target_dir : str , data : dict ) -> Tuple [ list , list ] : if 'dep' not in data : dep = sg . DEFAULT_DEPENDENCY else : dep = data [ 'dep' ] dep_files = glob . glob ( os . path . join ( driver_target_dir , dep ) , recursive = True ) if len ( dep_files ) <= 0 : return [ ] , [ ] file_profiles = { } for dep_file in dep_files : file_profiles = load_dependencies_config ( dep_file , file_profiles ) if 'profiles' not in file_profiles : return [ ] , [ ] file_profiles = file_profiles [ 'profiles' ] if 'default' not in file_profiles : raise DependencyProfileException ( 'No default profile for enlisted profiles. Found: ' + str ( file_profiles ) ) if 'profile' in data : requested_profile = data [ 'profile' ] if requested_profile not in file_profiles : raise DependencyProfileException ( 'Requested profile (' + requested_profile + ') not found. Found: ' + str ( file_profiles ) ) else : requested_profile = 'default' added_profiles : dict = file_profiles [ requested_profile ] print_idx ( idx , ' > Loaded profile (' + requested_profile + '): ' + str ( added_profiles ) ) grab_files = added_profiles [ 'grab-files' ] if 'grab-files' in added_profiles else "" grab_dirs = added_profiles [ 'grab_dirs' ] if 'grab_dirs' in added_profiles else "" return grab_files , grab_dirs
May install extra profiles
This method will check for a local dep file, and if present
check for a profiles key.
May install extra profiles This method will check for a local dep file and if present check for a profiles key .
"""May install extra profiles

       This method will check for a local dep file, and if present
       check for a profiles key. if present it will check for a selected profile in the data dict.
       If so, select it, if none, set the default
    Args:
        idx (str): index to use in multithreading
        driver_target_dir (str): target dir of the current driver
        data (str): data dict for local configuration
    Returns:
        (list,list) - a list of additional dependencies in the format 'files, folder'
    """ # load file and check for default # TODO: avoid reloading if recursive? # Note: I do want always a default profile so it makes live easier for me # TODO: this may be beautified
(list,list) - a list of additional dependencies in the format 'files, folder'
( list list ) - a list of additional dependencies in the format ' files folder '
idx
str
index to use in multithreading
index to use in multithreading
driver_target_dir
str
target dir of the current driver
target dir of the current driver
data
dict
data dict for local configuration
data dict for local configuration