plaso/engine/path_helper.py
def _ExpandUsersHomeDirectoryPathSegments(
      cls, path_segments, path_separator, user_accounts):
    """Expands a path to contain all users home or profile directories.

    Expands the artifacts path variable "%%users.homedir%%" or
    "%%users.userprofile%%".

    Args:
      path_segments (list[str]): path segments.
      path_separator (str): path segment separator.
      user_accounts (list[UserAccountArtifact]): user accounts.

    Returns:
      list[str]: paths returned for user accounts without a drive letter.
    """
    if not path_segments:
      return []

    user_paths = []

    first_path_segment = path_segments[0].upper()
    if first_path_segment not in ('%%USERS.HOMEDIR%%', '%%USERS.USERPROFILE%%'):
      user_path = path_separator.join(path_segments)
      user_paths.append(user_path)

    else:
      for user_account in user_accounts:
        user_path = user_account.user_directory
        # Prevent concatenating two consecutive path segment separators.
        if user_path[-1] == path_separator:
          user_path = user_path[:-1]

        user_path_segments = [user_path]
        user_path_segments.extend(path_segments[1:])

        user_path = path_separator.join(user_path_segments)
        user_paths.append(user_path)

    return [cls._StripDriveFromPath(user_path) for user_path in user_paths]
Expands a path to contain all users home or profile directories.

    Expands the artifacts path variable "%%users.homedir%%" or
    "%%users.userprofile%%".

    Args:
      path_segments (list[str]): path segments.
      path_separator (str): path segment separator.
      user_accounts (list[UserAccountArtifact]): user accounts.

    Returns:
      list[str]: paths returned for user accounts without a drive letter.
    
Expands a path to contain all users home or profile directories.
Expands a path to contain all users home or profile directories .
def _ExpandUsersHomeDirectoryPathSegments(
      cls, path_segments, path_separator, user_accounts):
    if not path_segments:
      return []
    user_paths = []
    first_path_segment = path_segments[0].upper()
    if first_path_segment not in ('%%USERS.HOMEDIR%%', '%%USERS.USERPROFILE%%'):
      user_path = path_separator.join(path_segments)
      user_paths.append(user_path)
    else:
      for user_account in user_accounts:
        user_path = user_account.user_directory
        if user_path[-1] == path_separator:
          user_path = user_path[:-1]
        user_path_segments = [user_path]
        user_path_segments.extend(path_segments[1:])
        user_path = path_separator.join(user_path_segments)
        user_paths.append(user_path)
    return [cls._StripDriveFromPath(user_path) for user_path in user_paths]
def _ExpandUsersHomeDirectoryPathSegments ( cls , path_segments , path_separator , user_accounts ) : if not path_segments : return [ ] user_paths = [ ] first_path_segment = path_segments [ 0 ] . upper ( ) if first_path_segment not in ( '%%USERS.HOMEDIR%%' , '%%USERS.USERPROFILE%%' ) : user_path = path_separator . join ( path_segments ) user_paths . append ( user_path ) else : for user_account in user_accounts : user_path = user_account . user_directory if user_path [ - 1 ] == path_separator : user_path = user_path [ : - 1 ] user_path_segments = [ user_path ] user_path_segments . extend ( path_segments [ 1 : ] ) user_path = path_separator . join ( user_path_segments ) user_paths . append ( user_path ) return [ cls . _StripDriveFromPath ( user_path ) for user_path in user_paths ]
Expands a path to contain all users home or profile directories.
Expands a path to contain all users home or profile directories .
"""Expands a path to contain all users home or profile directories.

    Expands the artifacts path variable "%%users.homedir%%" or
    "%%users.userprofile%%".

    Args:
      path_segments (list[str]): path segments.
      path_separator (str): path segment separator.
      user_accounts (list[UserAccountArtifact]): user accounts.

    Returns:
      list[str]: paths returned for user accounts without a drive letter.
    """ # Prevent concatenating two consecutive path segment separators.
paths returned for user accounts without a drive letter.
paths returned for user accounts without a drive letter .
list[str]
cls
path_segments
None
path_separator
path segment separator.
path segment separator .
user_accounts
None