File: xml_serializer.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (70 lines) | stat: -rw-r--r-- 2,464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from contextlib import AbstractContextManager
from typing import IO, Any
from xml.sax.expatreader import ExpatParser

from django.core.serializers import base

def fast_cache_clearing() -> AbstractContextManager[None]: ...

class Serializer(base.Serializer):
    def indent(self, level: int) -> None: ...
    xml: Any
    def start_serialization(self) -> None: ...
    def end_serialization(self) -> None: ...
    def start_object(self, obj: Any) -> None: ...
    def end_object(self, obj: Any) -> None: ...
    def handle_field(self, obj: Any, field: Any) -> None: ...
    def handle_fk_field(self, obj: Any, field: Any) -> None: ...
    def handle_m2m_field(self, obj: Any, field: Any) -> None: ...

class Deserializer(base.Deserializer):
    handle_forward_references: bool
    event_stream: Any
    db: str
    ignore: bool
    def __init__(
        self,
        stream_or_string: bytes | str | IO[bytes] | IO[str],
        *,
        using: str = ...,
        ignorenonexistent: bool = ...,
        **options: Any,
    ) -> None: ...
    def __next__(self) -> base.DeserializedObject: ...

def getInnerText(node: Any) -> str: ...
def getInnerTextList(node: Any) -> list[str]: ...

class DefusedExpatParser(ExpatParser):
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def start_doctype_decl(self, name: Any, sysid: Any, pubid: Any, has_internal_subset: Any) -> None: ...
    def entity_decl(
        self, name: Any, is_parameter_entity: Any, value: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any
    ) -> None: ...
    def unparsed_entity_decl(self, name: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any) -> None: ...
    def external_entity_ref_handler(self, context: Any, base: Any, sysid: Any, pubid: Any) -> None: ...
    def reset(self) -> None: ...

class DefusedXmlException(ValueError): ...

class DTDForbidden(DefusedXmlException):
    name: Any
    sysid: Any
    pubid: Any
    def __init__(self, name: Any, sysid: Any, pubid: Any) -> None: ...

class EntitiesForbidden(DefusedXmlException):
    name: Any
    value: Any
    base: Any
    sysid: Any
    pubid: Any
    notation_name: Any
    def __init__(self, name: Any, value: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any) -> None: ...

class ExternalReferenceForbidden(DefusedXmlException):
    context: Any
    base: Any
    sysid: Any
    pubid: Any
    def __init__(self, context: Any, base: Any, sysid: Any, pubid: Any) -> None: ...