GRAYBYTE WORDPRESS FILE MANAGER7832

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/contracts/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


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))

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 11 2025 07:52:56
root / root
0755
__pycache__
--
July 11 2025 07:52:56
root / root
0755
__init__.py
0 KB
July 09 2025 15:10:25
root / root
0644
config.py
41.287 KB
July 09 2025 15:14:43
root / root
0644
config_provider.py
9.358 KB
July 09 2025 15:10:25
root / root
0644
eula.py
1.471 KB
July 09 2025 15:10:25
root / root
0644
hook_events.py
1.512 KB
July 09 2025 15:10:25
root / root
0644
hooks.py
6.143 KB
July 09 2025 15:10:25
root / root
0644
license.py
19.31 KB
July 09 2025 15:10:25
root / root
0644
messages.py
12.074 KB
July 09 2025 15:10:25
root / root
0644
myimunify_id.py
4.396 KB
July 09 2025 15:10:25
root / root
0644
permissions.py
5.4 KB
July 09 2025 15:10:25
root / root
0644
plugins.py
8.103 KB
July 09 2025 15:10:25
root / root
0644
sentry.py
2.875 KB
July 09 2025 15:10:25
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF