gui/backend/gui_plugin/core/Files.py
def list_files(path="", web_session=None):
    """Returns the contents of a directory.

    It gets the contents of the specified directory and returns them.
    If running in multi-user mode, the directory is relative to the user space and requests
    outside the user space will result in error.
    If running in single-user mode, absolute paths area allowed, but if a relative path is
    supplied, then it will be relative to the system user home directory.
    If the path is empty, "." or "./" it will be resolved as the root to the relative
    path in the running mode.

    Args:
        path (str): The path to get the contents from
        web_session (object): The webserver session object, optional. Will be
            passed in my the webserver automatically

    Returns:
        A list of files that exist in the requested directory
    """

    # the rel_path is the full_path on local sessions
    full_path, rel_path = resolve_path(path, web_session)

    if not os.path.exists(full_path):
        raise MSGException(Error.CORE_PATH_NOT_EXIST,
                            "The supplied path does not exist.")

    if not os.path.isdir(full_path):
        raise MSGException(Error.CORE_NOT_DIRECTORY,
                            "The supplied path is not a directory.")

    if not os.access(full_path, os.R_OK):
        raise MSGException(Error.CORE_PERMISSION_DENIED,
                            "No permissions to access the directory.")

    list_of_files = []
    for item in os.listdir(full_path):
        p = Path(os.path.join(rel_path, item))
        list_of_files.append(p.as_posix())

    result = Response.ok("Files in directory", {
        "result": list_of_files
    })

    return result
Returns the contents of a directory.

    It gets the contents of the specified directory and returns them.
    If running in multi-user mode, the directory is relative to the user space and requests
    outside the user space will result in error.
    If running in single-user mode, absolute paths area allowed, but if a relative path is
    supplied, then it will be relative to the system user home directory.
    If the path is empty, "." or "./" it will be resolved as the root to the relative
    path in the running mode.

    Args:
        path (str): The path to get the contents from
        web_session (object): The webserver session object, optional. Will be
            passed in my the webserver automatically

    Returns:
        A list of files that exist in the requested directory
    
Returns the contents of a directory.
It gets the contents of the specified directory and returns them.
If running in multi-user mode, the directory is relative to the user space and requests
outside the user space will result in error.
If running in single-user mode, absolute paths area allowed, but if a relative path is
supplied, then it will be relative to the system user home directory.
If the path is empty, "." or "./" it will be resolved as the root to the relative
path in the running mode.
Returns the contents of a directory . It gets the contents of the specified directory and returns them . If running in multi - user mode the directory is relative to the user space and requests outside the user space will result in error . If running in single - user mode absolute paths area allowed but if a relative path is supplied then it will be relative to the system user home directory . If the path is empty " . " or " . / " it will be resolved as the root to the relative path in the running mode .
def list_files(path="", web_session=None):
    full_path, rel_path = resolve_path(path, web_session)
    if not os.path.exists(full_path):
        raise MSGException(Error.CORE_PATH_NOT_EXIST,
                            "The supplied path does not exist.")
    if not os.path.isdir(full_path):
        raise MSGException(Error.CORE_NOT_DIRECTORY,
                            "The supplied path is not a directory.")
    if not os.access(full_path, os.R_OK):
        raise MSGException(Error.CORE_PERMISSION_DENIED,
                            "No permissions to access the directory.")
    list_of_files = []
    for item in os.listdir(full_path):
        p = Path(os.path.join(rel_path, item))
        list_of_files.append(p.as_posix())
    result = Response.ok("Files in directory", {
        "result": list_of_files
    })
    return result
def list_files ( path = "" , web_session = None ) : full_path , rel_path = resolve_path ( path , web_session ) if not os . path . exists ( full_path ) : raise MSGException ( Error . CORE_PATH_NOT_EXIST , "The supplied path does not exist." ) if not os . path . isdir ( full_path ) : raise MSGException ( Error . CORE_NOT_DIRECTORY , "The supplied path is not a directory." ) if not os . access ( full_path , os . R_OK ) : raise MSGException ( Error . CORE_PERMISSION_DENIED , "No permissions to access the directory." ) list_of_files = [ ] for item in os . listdir ( full_path ) : p = Path ( os . path . join ( rel_path , item ) ) list_of_files . append ( p . as_posix ( ) ) result = Response . ok ( "Files in directory" , { "result" : list_of_files } ) return result
Returns the contents of a directory.
Returns the contents of a directory .
"""Returns the contents of a directory.

    It gets the contents of the specified directory and returns them.
    If running in multi-user mode, the directory is relative to the user space and requests
    outside the user space will result in error.
    If running in single-user mode, absolute paths area allowed, but if a relative path is
    supplied, then it will be relative to the system user home directory.
    If the path is empty, "." or "./" it will be resolved as the root to the relative
    path in the running mode.

    Args:
        path (str): The path to get the contents from
        web_session (object): The webserver session object, optional. Will be
            passed in my the webserver automatically

    Returns:
        A list of files that exist in the requested directory
    """ # the rel_path is the full_path on local sessions
A list of files that exist in the requested directory
A list of files that exist in the requested directory
path
The path to get the contents from
The path to get the contents from
web_session
The webserver session object, optional. Will be
passed in my the webserver automatically
The webserver session object optional . Will be passed in my the webserver automatically