def app_cleanup(app, request):
    """Removes session, cache and error files

    Args:
        app(str): application name
        request: the global request object

    Returns:
        True if everything went ok, False otherwise

    """
    r = True

    # Remove error files
    path = apath('%s/errors/' % app, request)
    if os.path.exists(path):
        for f in os.listdir(path):
            try:
                if f[:1] == '.': os.unlink(os.path.join(path, f))
            except IOError:
                r = False

    # Remove session files
    path = apath('%s/sessions/' % app, request)
    if os.path.exists(path):
        for f in os.listdir(path):
            try:
                if f[:1] != '.': recursive_unlink(os.path.join(path, f))
            except IOError:
                r = False

    # Remove cache files
    path = apath('%s/cache/' % app, request)
    if os.path.exists(path):
        for f in os.listdir(path):
            try:
                if f[:1] != '.': os.unlink(os.path.join(path, f))
            except IOError:
                r = False
    return r
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/admin.py/app_cleanup/operator `!=` -> `==`