$22 GRAYBYTE WORDPRESS FILE MANAGER $13

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/contracts/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/contracts//eula.py
import asyncio
import os.path
from typing import Optional

from defence360agent import files
from defence360agent.contracts.config import ANTIVIRUS_MODE
from defence360agent.model.simplification import Eula, run_in_executor


_MESSAGE_TEMPLATE = "message{}.txt"
_SUFFIX = "-av" if ANTIVIRUS_MODE else ""
_TEXT_TEMPLATE = "eula{}.txt"
_UPDATED_TEMPLATE = "updated{}.txt"


def _readfile(path: str, errors: Optional[str] = None) -> str:
    with open(path, errors=errors) as f:
        return f.read().strip()


def _get_path(template: str) -> str:
    return os.path.join(
        files.Index.files_path(files.EULA), template.format(_SUFFIX)
    )


async def is_accepted() -> bool:
    """Return True if latest EULA was accepted, False otherwise."""
    return await run_in_executor(asyncio.get_event_loop(), Eula.is_accepted)


async def accept() -> None:
    """Accepts EULA."""
    await run_in_executor(asyncio.get_event_loop(), Eula.accept)


async def update() -> None:
    """Updates latest EULA date from files."""
    await run_in_executor(
        asyncio.get_event_loop(), lambda: Eula.get_or_create(updated=updated())
    )


def text() -> str:
    """Return main text of the EULA."""
    return _readfile(_get_path(_TEXT_TEMPLATE), errors="ignore")


def message() -> str:
    """Return a message inviting to accept EULA."""
    return _readfile(_get_path(_MESSAGE_TEMPLATE))


def updated() -> str:
    """Return last EULA's update time."""
    return _readfile(_get_path(_UPDATED_TEMPLATE))


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2026 8.45 AM
root / root
0755
__pycache__
--
3 Mar 2026 8.45 AM
root / root
0755
__init__.py
0 KB
23 Jan 2026 1.13 PM
root / root
0644
config.py
42.008 KB
23 Jan 2026 1.29 PM
root / root
0644
config_provider.py
9.358 KB
23 Jan 2026 1.13 PM
root / root
0644
eula.py
1.471 KB
23 Jan 2026 1.13 PM
root / root
0644
hook_events.py
1.512 KB
23 Jan 2026 1.13 PM
root / root
0644
hooks.py
6.131 KB
23 Jan 2026 1.13 PM
root / root
0644
license.py
21.273 KB
23 Jan 2026 1.13 PM
root / root
0644
messages.py
12.004 KB
23 Jan 2026 1.13 PM
root / root
0644
myimunify_id.py
4.396 KB
23 Jan 2026 1.13 PM
root / root
0644
permissions.py
6.007 KB
23 Jan 2026 1.13 PM
root / root
0644
plugins.py
8.103 KB
23 Jan 2026 1.13 PM
root / root
0644
sentry.py
2.975 KB
23 Jan 2026 1.13 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF