!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/var/lib/snapd/snap/core24/1006/usr/lib/python3/dist-packages/netplan/   drwxr-xr-x
Free 0 B of 66.88 MB (0%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     parser.py (2.46 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Copyright (C) 2023 Canonical, Ltd.
# Author: Lukas Märdian <slyon@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from enum import IntEnum
from typing import Union, IO

from ._netplan_cffi import ffi, lib
from ._utils import _checked_lib_call


class Flags(IntEnum):
    IGNORE_ERRORS = 1 << 0


class Parser():
    def __init__(self):
        self._ptr = lib.netplan_parser_new()

    def __del__(self):
        ref = ffi.new('NetplanParser **', self._ptr)
        lib.netplan_parser_clear(ref)

    def load_yaml(self, input_file: Union[str, IO]):
        if isinstance(input_file, str):
            return _checked_lib_call(lib.netplan_parser_load_yaml, self._ptr, input_file.encode('utf-8'))
        else:
            return _checked_lib_call(lib.netplan_parser_load_yaml_from_fd, self._ptr, input_file.fileno())

    def load_yaml_hierarchy(self, rootdir: str = None):
        root = rootdir.encode('utf-8') if rootdir else ffi.NULL
        return _checked_lib_call(lib.netplan_parser_load_yaml_hierarchy, self._ptr, root)

    def load_keyfile(self, input_file: str):  # TODO: load from File/fd (i.e. input_file: Union[str, IO])
        return _checked_lib_call(lib.netplan_parser_load_keyfile, self._ptr, input_file.encode('utf-8'))

    def load_nullable_fields(self, input_file: IO):
        return _checked_lib_call(lib.netplan_parser_load_nullable_fields, self._ptr, input_file.fileno())

    def _load_nullable_overrides(self, input_file: IO, constraint: str):
        return _checked_lib_call(lib.netplan_parser_load_nullable_overrides,
                                 self._ptr, input_file.fileno(), constraint.encode('utf-8'))

    @property
    def flags(self) -> int:
        return lib.netplan_parser_get_flags(self._ptr)

    @flags.setter
    def flags(self, flags: int):
        _ = _checked_lib_call(lib.netplan_parser_set_flags, self._ptr, flags)

    @property
    def error_count(self) -> int:
        return lib.netplan_parser_get_error_count(self._ptr)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0053 ]--