1
- # ./cabecalho_v03.py
1
+ # flake8: noqa
2
+ # pynfe/utils/nfse/ginfes/cabecalho_v03.py
2
3
# -*- coding: utf-8 -*-
3
4
# PyXB bindings for NM:1981a932e981e99644ad0c4bcf57cfb2bf9f2e12
4
- # Generated 2015-12-21 11:05:54.422726 by PyXB version 1.2.4 using Python 3.5.1 .final.0
5
+ # Generated 2025-04-06 00:00:40.741528 by PyXB version 1.2.6 using Python 3.12.9 .final.0
5
6
# Namespace http://www.ginfes.com.br/cabecalho_v03.xsd
6
7
7
8
from __future__ import unicode_literals
11
12
import io
12
13
import pyxb .utils .utility
13
14
import pyxb .utils .domutils
15
+ import sys
14
16
import pyxb .utils .six as _six
17
+ # Unique identifier for bindings created at the same time
18
+ _GenerationUID = pyxb .utils .utility .UniqueIdentifier ('urn:uuid:0e2620f4-a7e2-497f-ac67-2bf21c9dfe3d' )
19
+
20
+ # Version of PyXB used to generate the bindings
21
+ _PyXBVersion = '1.2.6'
22
+
23
+ # A holder for module-level binding classes so we can access them from
24
+ # inside class definitions where property names may conflict.
25
+ _module_typeBindings = pyxb .utils .utility .Object ()
15
26
16
27
# Import bindings for namespaces imported into schema
17
28
from pynfe .utils .nfse .ginfes import _tipos as _ImportedBinding__tipos
18
29
import pyxb .binding .datatypes
19
30
20
- # Unique identifier for bindings created at the same time
21
- _GenerationUID = pyxb .utils .utility .UniqueIdentifier (
22
- "urn:uuid:9150f830-a7e3-11e5-9c9b-b8ee65084bc8"
23
- )
24
-
25
- # Version of PyXB used to generate the bindings
26
- _PyXBVersion = "1.2.4"
27
- # Generated bindings are not compatible across PyXB versions
28
- if pyxb .__version__ != _PyXBVersion :
29
- raise pyxb .PyXBVersionError (_PyXBVersion )
30
-
31
31
# NOTE: All namespace declarations are reserved within the binding
32
- Namespace = pyxb .namespace .NamespaceForURI (
33
- "http://www.ginfes.com.br/cabecalho_v03.xsd" , create_if_missing = True
34
- )
35
- Namespace .configureCategories (["typeBinding" , "elementBinding" ])
36
-
32
+ Namespace = pyxb .namespace .NamespaceForURI ('http://www.ginfes.com.br/cabecalho_v03.xsd' , create_if_missing = True )
33
+ Namespace .configureCategories (['typeBinding' , 'elementBinding' ])
37
34
38
- def CreateFromDocument (xml_text , default_namespace = None , location_base = None ):
35
+ def CreateFromDocument (xml_text , fallback_namespace = None , location_base = None , default_namespace = None ):
39
36
"""Parse the given XML and use the document element to create a
40
37
Python instance.
41
38
42
39
@param xml_text An XML document. This should be data (Python 2
43
40
str or Python 3 bytes), or a text (Python 2 unicode or Python 3
44
41
str) in the L{pyxb._InputEncoding} encoding.
45
42
46
- @keyword default_namespace The L{pyxb.Namespace} instance to use as the
47
- default namespace where there is no default namespace in scope.
48
- If unspecified or C{None}, the namespace of the module containing
49
- this function will be used.
43
+ @keyword fallback_namespace An absent L{pyxb.Namespace} instance
44
+ to use for unqualified names when there is no default namespace in
45
+ scope. If unspecified or C{None}, the namespace of the module
46
+ containing this function will be used, if it is an absent
47
+ namespace.
50
48
51
49
@keyword location_base: An object to be recorded as the base of all
52
50
L{pyxb.utils.utility.Location} instances associated with events and
53
51
objects handled by the parser. You might pass the URI from which
54
52
the document was obtained.
53
+
54
+ @keyword default_namespace An alias for @c fallback_namespace used
55
+ in PyXB 1.1.4 through 1.2.6. It behaved like a default namespace
56
+ only for absent namespaces.
55
57
"""
56
58
57
59
if pyxb .XMLStyle_saxer != pyxb ._XMLStyle :
58
60
dom = pyxb .utils .domutils .StringToDOM (xml_text )
59
- return CreateFromDOM (dom .documentElement , default_namespace = default_namespace )
60
- if default_namespace is None :
61
- default_namespace = Namespace . fallbackNamespace ()
62
- saxer = pyxb . binding . saxer . make_parser (
63
- fallback_namespace = default_namespace , location_base = location_base
64
- )
61
+ return CreateFromDOM (dom .documentElement )
62
+ if fallback_namespace is None :
63
+ fallback_namespace = default_namespace
64
+ if fallback_namespace is None :
65
+ fallback_namespace = Namespace . fallbackNamespace ()
66
+ saxer = pyxb . binding . saxer . make_parser ( fallback_namespace = fallback_namespace , location_base = location_base )
65
67
handler = saxer .getContentHandler ()
66
68
xmld = xml_text
67
69
if isinstance (xmld , _six .text_type ):
@@ -70,90 +72,61 @@ def CreateFromDocument(xml_text, default_namespace=None, location_base=None):
70
72
instance = handler .rootObject ()
71
73
return instance
72
74
73
-
74
- def CreateFromDOM (node , default_namespace = None ):
75
+ def CreateFromDOM (node , fallback_namespace = None , default_namespace = None ):
75
76
"""Create a Python instance from the given DOM node.
76
77
The node tag must correspond to an element declaration in this module.
77
78
78
- @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}.
79
- """
80
- if default_namespace is None :
81
- default_namespace = Namespace .fallbackNamespace ()
82
- return pyxb .binding .basis .element .AnyCreateFromDOM (node , default_namespace )
79
+ @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}."""
80
+ if fallback_namespace is None :
81
+ fallback_namespace = default_namespace
82
+ if fallback_namespace is None :
83
+ fallback_namespace = Namespace .fallbackNamespace ()
84
+ return pyxb .binding .basis .element .AnyCreateFromDOM (node , fallback_namespace )
83
85
84
86
85
87
# Complex type [anonymous] with content type ELEMENT_ONLY
86
- class CTD_ANON (pyxb .binding .basis .complexTypeDefinition ):
88
+ class CTD_ANON (pyxb .binding .basis .complexTypeDefinition ):
87
89
"""Complex type [anonymous] with content type ELEMENT_ONLY"""
88
-
89
90
_TypeDefinition = None
90
91
_ContentTypeTag = pyxb .binding .basis .complexTypeDefinition ._CT_ELEMENT_ONLY
91
92
_Abstract = False
92
93
_ExpandedName = None
93
- _XSDLocation = pyxb .utils .utility .Location (
94
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 8 , 2
95
- )
94
+ _XSDLocation = pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 8 , 2 )
96
95
_ElementMap = {}
97
96
_AttributeMap = {}
98
97
# Base type is pyxb.binding.datatypes.anyType
99
-
98
+
100
99
# Element versaoDados uses Python identifier versaoDados
101
- __versaoDados = pyxb .binding .content .ElementDeclaration (
102
- pyxb .namespace .ExpandedName (None , "versaoDados" ),
103
- "versaoDados" ,
104
- "__httpwww_ginfes_com_brcabecalho_v03_xsd_CTD_ANON_versaoDados" ,
105
- False ,
106
- pyxb .utils .utility .Location (
107
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 10 , 4
108
- ),
109
- )
100
+ __versaoDados = pyxb .binding .content .ElementDeclaration (pyxb .namespace .ExpandedName (None , 'versaoDados' ), 'versaoDados' , '__httpwww_ginfes_com_brcabecalho_v03_xsd_CTD_ANON_versaoDados' , False , pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 10 , 4 ), )
110
101
102
+
111
103
versaoDados = property (__versaoDados .value , __versaoDados .set , None , None )
112
104
105
+
113
106
# Attribute versao uses Python identifier versao
114
- __versao = pyxb .binding .content .AttributeUse (
115
- pyxb .namespace .ExpandedName (None , "versao" ),
116
- "versao" ,
117
- "__httpwww_ginfes_com_brcabecalho_v03_xsd_CTD_ANON_versao" ,
118
- _ImportedBinding__tipos .tsVersao ,
119
- required = True ,
120
- )
121
- __versao ._DeclarationLocation = pyxb .utils .utility .Location (
122
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 13 , 3
123
- )
124
- __versao ._UseLocation = pyxb .utils .utility .Location (
125
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 13 , 3
126
- )
127
-
107
+ __versao = pyxb .binding .content .AttributeUse (pyxb .namespace .ExpandedName (None , 'versao' ), 'versao' , '__httpwww_ginfes_com_brcabecalho_v03_xsd_CTD_ANON_versao' , _ImportedBinding__tipos .tsVersao , required = True )
108
+ __versao ._DeclarationLocation = pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 13 , 3 )
109
+ __versao ._UseLocation = pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 13 , 3 )
110
+
128
111
versao = property (__versao .value , __versao .set , None , None )
129
112
130
- _ElementMap .update ({__versaoDados .name (): __versaoDados })
131
- _AttributeMap .update ({__versao .name (): __versao })
113
+ _ElementMap .update ({
114
+ __versaoDados .name () : __versaoDados
115
+ })
116
+ _AttributeMap .update ({
117
+ __versao .name () : __versao
118
+ })
119
+ _module_typeBindings .CTD_ANON = CTD_ANON
132
120
133
121
134
- cabecalho = pyxb .binding .basis .element (
135
- pyxb .namespace .ExpandedName (Namespace , "cabecalho" ),
136
- CTD_ANON ,
137
- location = pyxb .utils .utility .Location (
138
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 7 , 1
139
- ),
140
- )
141
- Namespace .addCategoryObject ("elementBinding" , cabecalho .name ().localName (), cabecalho )
122
+ cabecalho = pyxb .binding .basis .element (pyxb .namespace .ExpandedName (Namespace , 'cabecalho' ), CTD_ANON , location = pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 7 , 1 ))
123
+ Namespace .addCategoryObject ('elementBinding' , cabecalho .name ().localName (), cabecalho )
142
124
143
125
144
- CTD_ANON ._AddElement (
145
- pyxb .binding .basis .element (
146
- pyxb .namespace .ExpandedName (None , "versaoDados" ),
147
- _ImportedBinding__tipos .tsVersao ,
148
- scope = CTD_ANON ,
149
- location = pyxb .utils .utility .Location (
150
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 10 , 4
151
- ),
152
- )
153
- )
154
126
127
+ CTD_ANON ._AddElement (pyxb .binding .basis .element (pyxb .namespace .ExpandedName (None , 'versaoDados' ), _ImportedBinding__tipos .tsVersao , scope = CTD_ANON , location = pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 10 , 4 )))
155
128
156
- def _BuildAutomaton ():
129
+ def _BuildAutomaton ():
157
130
# Remove this helper function from the namespace after it is invoked
158
131
global _BuildAutomaton
159
132
del _BuildAutomaton
@@ -162,22 +135,11 @@ def _BuildAutomaton():
162
135
counters = set ()
163
136
states = []
164
137
final_update = set ()
165
- symbol = pyxb .binding .content .ElementUse (
166
- CTD_ANON ._UseForTag (pyxb .namespace .ExpandedName (None , "versaoDados" )),
167
- pyxb .utils .utility .Location (
168
- "/home/leonardo/Downloads/cabecalho_v03.xsd" , 10 , 4
169
- ),
170
- )
171
- st_0 = fac .State (
172
- symbol ,
173
- is_initial = True ,
174
- final_update = final_update ,
175
- is_unordered_catenation = False ,
176
- )
138
+ symbol = pyxb .binding .content .ElementUse (CTD_ANON ._UseForTag (pyxb .namespace .ExpandedName (None , 'versaoDados' )), pyxb .utils .utility .Location ('/workspaces/PyNFe/pynfe/data/XSDs/NFS-e/Ginfes/cabecalho_v03.xsd' , 10 , 4 ))
139
+ st_0 = fac .State (symbol , is_initial = True , final_update = final_update , is_unordered_catenation = False )
177
140
states .append (st_0 )
178
141
transitions = []
179
142
st_0 ._set_transitionSet (transitions )
180
143
return fac .Automaton (states , counters , False , containing_state = None )
181
-
182
-
183
144
CTD_ANON ._Automaton = _BuildAutomaton ()
145
+
0 commit comments