GRAYBYTE WORDPRESS FILE MANAGER1219

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/cloudlinux/venv/lib/python3.11/site-packages/setoptconf/source/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


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

import yaml

from .filebased import FileBasedSource


__all__ = ("YamlFileSource",)


class YamlFileSource(FileBasedSource):
    def __init__(self, *args, **kwargs):
        self.encoding = kwargs.pop("encoding", "utf-8")
        super(YamlFileSource, 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 = yaml.safe_load(content)
        if not content:
            return None

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

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

        return settings

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 15 2025 08:30:34
root / root
0755
__pycache__
--
May 15 2025 08:30:34
root / root
0755
__init__.py
0.329 KB
April 17 2025 13:10:58
root / root
0644
base.py
0.142 KB
April 17 2025 13:10:58
root / root
0644
commandline.py
4.979 KB
April 17 2025 13:10:58
root / root
0644
configfile.py
0.955 KB
April 17 2025 13:10:58
root / root
0644
environment.py
0.978 KB
April 17 2025 13:10:58
root / root
0644
filebased.py
2.578 KB
April 17 2025 13:10:58
root / root
0644
jsonfile.py
0.827 KB
April 17 2025 13:10:58
root / root
0644
mapping.py
0.48 KB
April 17 2025 13:10:58
root / root
0644
modobj.py
1.674 KB
April 17 2025 13:10:58
root / root
0644
yamlfile.py
0.833 KB
April 17 2025 13:10:58
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF