$53 GRAYBYTE WORDPRESS FILE MANAGER $47

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/setoptconf/source/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/setoptconf/source//jsonfile.py
import codecs
import json

from .filebased import FileBasedSource


__all__ = ("JsonFileSource",)


class JsonFileSource(FileBasedSource):
    def __init__(self, *args, **kwargs):
        self.encoding = kwargs.pop("encoding", "utf-8")
        super(JsonFileSource, self).__init__(*args, **kwargs)

    def get_settings_from_file(self, file_path, settings, manager=None):
        content = codecs.open(file_path, "r", self.encoding).read().strip()
        if not content:
            return None

        content = json.loads(content)
        if not content:
            return None

        if not isinstance(content, dict):
            raise TypeError("JSON files must contain only objects")

        for setting in settings:
            if setting.name in content:
                setting.value = content[setting.name]

        return settings

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.329 KB
17 Apr 2025 8.10 PM
root / root
0644
base.py
0.142 KB
17 Apr 2025 8.10 PM
root / root
0644
commandline.py
4.979 KB
17 Apr 2025 8.10 PM
root / root
0644
configfile.py
0.955 KB
17 Apr 2025 8.10 PM
root / root
0644
environment.py
0.978 KB
17 Apr 2025 8.10 PM
root / root
0644
filebased.py
2.578 KB
17 Apr 2025 8.10 PM
root / root
0644
jsonfile.py
0.827 KB
17 Apr 2025 8.10 PM
root / root
0644
mapping.py
0.48 KB
17 Apr 2025 8.10 PM
root / root
0644
modobj.py
1.674 KB
17 Apr 2025 8.10 PM
root / root
0644
yamlfile.py
0.833 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF