sc-oa 0.7.0.13__py3-none-any.whl → 0.7.0.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sc-oa might be problematic. Click here for more details.

@@ -1,58 +1,58 @@
1
- """
2
- sphinxcontrib.openapi.directive
3
- -------------------------------
4
-
5
- The main directive for the extension.
6
-
7
- :copyright: (c) 2016, Ihor Kalnytskyi.
8
- :license: BSD, see LICENSE for details.
9
- """
10
-
11
- import functools
12
-
13
- from docutils.parsers.rst import directives
14
- from sphinx.util.docutils import SphinxDirective
15
- import yaml
16
-
17
-
18
- # Locally cache spec to speedup processing of same spec file in multiple
19
- # openapi directives
20
- @functools.lru_cache()
21
- def _get_spec(abspath, encoding):
22
- with open(abspath, 'rt', encoding=encoding) as stream:
23
- return yaml.safe_load(stream)
24
-
25
-
26
- def create_directive_from_renderer(renderer_cls):
27
- """Create rendering directive from a renderer class."""
28
-
29
- class _RenderingDirective(SphinxDirective):
30
- required_arguments = 1 # path to openapi spec
31
- final_argument_whitespace = True # path may contain whitespaces
32
- option_spec = dict(
33
- {
34
- 'encoding': directives.encoding, # useful for non-ascii cases :)
35
- },
36
- **renderer_cls.option_spec
37
- )
38
-
39
- def run(self):
40
- relpath, abspath = self.env.relfn2path(directives.path(self.arguments[0]))
41
-
42
- # URI parameter is crucial for resolving relative references. So we
43
- # need to set this option properly as it's used later down the
44
- # stack.
45
- self.options.setdefault('uri', 'file:///%s' % abspath.replace('\\', '/'))
46
-
47
- # Add a given OpenAPI spec as a dependency of the referring
48
- # reStructuredText document, so the document is rebuilt each time
49
- # the spec is changed.
50
- self.env.note_dependency(relpath)
51
-
52
- # Read the spec using encoding passed to the directive or fallback to
53
- # the one specified in Sphinx's config.
54
- encoding = self.options.get('encoding', self.config.source_encoding)
55
- spec = _get_spec(abspath, encoding)
56
- return renderer_cls(self.state, self.options).render(spec)
57
-
58
- return _RenderingDirective
1
+ """
2
+ sphinxcontrib.openapi.directive
3
+ -------------------------------
4
+
5
+ The main directive for the extension.
6
+
7
+ :copyright: (c) 2016, Ihor Kalnytskyi.
8
+ :license: BSD, see LICENSE for details.
9
+ """
10
+
11
+ import functools
12
+
13
+ from docutils.parsers.rst import directives
14
+ from sphinx.util.docutils import SphinxDirective
15
+ import yaml
16
+
17
+
18
+ # Locally cache spec to speedup processing of same spec file in multiple
19
+ # openapi directives
20
+ @functools.lru_cache()
21
+ def _get_spec(abspath, encoding):
22
+ with open(abspath, 'rt', encoding=encoding) as stream:
23
+ return yaml.safe_load(stream)
24
+
25
+
26
+ def create_directive_from_renderer(renderer_cls):
27
+ """Create rendering directive from a renderer class."""
28
+
29
+ class _RenderingDirective(SphinxDirective):
30
+ required_arguments = 1 # path to openapi spec
31
+ final_argument_whitespace = True # path may contain whitespaces
32
+ option_spec = dict(
33
+ {
34
+ 'encoding': directives.encoding, # useful for non-ascii cases :)
35
+ },
36
+ **renderer_cls.option_spec
37
+ )
38
+
39
+ def run(self):
40
+ relpath, abspath = self.env.relfn2path(directives.path(self.arguments[0]))
41
+
42
+ # URI parameter is crucial for resolving relative references. So we
43
+ # need to set this option properly as it's used later down the
44
+ # stack.
45
+ self.options.setdefault('uri', 'file:///%s' % abspath.replace('\\', '/'))
46
+
47
+ # Add a given OpenAPI spec as a dependency of the referring
48
+ # reStructuredText document, so the document is rebuilt each time
49
+ # the spec is changed.
50
+ self.env.note_dependency(relpath)
51
+
52
+ # Read the spec using encoding passed to the directive or fallback to
53
+ # the one specified in Sphinx's config.
54
+ encoding = self.options.get('encoding', self.config.source_encoding)
55
+ spec = _get_spec(abspath, encoding)
56
+ return renderer_cls(self.state, self.options).render(spec)
57
+
58
+ return _RenderingDirective
@@ -1,170 +1,170 @@
1
- # Spanish translations for PROJECT.
2
- # Copyright (C) 2022 ORGANIZATION
3
- # This file is distributed under the same license as the PROJECT project.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: PROJECT VERSION\n"
9
- "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
- "POT-Creation-Date: 2022-04-23 02:37+0200\n"
11
- "PO-Revision-Date: 2022-04-19 15:19+0200\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language: es\n"
14
- "Language-Team: es <LL@li.org>\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1)\n"
16
- "MIME-Version: 1.0\n"
17
- "Content-Type: text/plain; charset=utf-8\n"
18
- "Content-Transfer-Encoding: 8bit\n"
19
- "Generated-By: Babel 2.9.1\n"
20
-
21
- #: sphinxcontrib/openapi/openapi30.py:206
22
- #: sphinxcontrib/openapi/openapi30.py:241
23
- msgid "Example request"
24
- msgstr "Ejemplo de solicitud"
25
-
26
- #: sphinxcontrib/openapi/openapi30.py:237
27
- msgid "Example response"
28
- msgstr "Ejemplo de respuesta"
29
-
30
- #: sphinxcontrib/openapi/openapi30.py:333
31
- msgid "Scope required"
32
- msgstr "Permiso"
33
-
34
- #: sphinxcontrib/openapi/openapi30.py:344
35
- msgid "Object of"
36
- msgstr "Objeto de"
37
-
38
- #: sphinxcontrib/openapi/openapi30.py:344
39
- msgid "Array of"
40
- msgstr "Lista de"
41
-
42
- #: sphinxcontrib/openapi/openapi30.py:345
43
- #: sphinxcontrib/openapi/renderers/_model.py:121
44
- msgid "Object of type {}"
45
- msgstr "Objeto de tipo {}"
46
-
47
- #: sphinxcontrib/openapi/openapi30.py:349
48
- #: sphinxcontrib/openapi/openapi30.py:359
49
- #: sphinxcontrib/openapi/renderers/_model.py:190
50
- msgid "Additional properties"
51
- msgstr "Propiedades adicionales"
52
-
53
- #: sphinxcontrib/openapi/openapi30.py:389
54
- #: sphinxcontrib/openapi/renderers/_model.py:266
55
- msgid "Required"
56
- msgstr "Requerido"
57
-
58
- #: sphinxcontrib/openapi/openapi30.py:408
59
- msgid "Request body:"
60
- msgstr "Cuerpo de la solicitud:"
61
-
62
- #: sphinxcontrib/openapi/renderers/_model.py:31
63
- msgid "minItems is {}"
64
- msgstr "minItems es {}"
65
-
66
- #: sphinxcontrib/openapi/renderers/_model.py:33
67
- msgid "maxItems is {}"
68
- msgstr "maxItems es {}"
69
-
70
- #: sphinxcontrib/openapi/renderers/_model.py:35
71
- msgid "minLength is {}"
72
- msgstr "minLength es {}"
73
-
74
- #: sphinxcontrib/openapi/renderers/_model.py:37
75
- msgid "maxLength is {}"
76
- msgstr "maxLength es {}"
77
-
78
- #: sphinxcontrib/openapi/renderers/_model.py:39
79
- msgid "minimum is {}"
80
- msgstr "mínimo es {}"
81
-
82
- #: sphinxcontrib/openapi/renderers/_model.py:41
83
- msgid "maximum is {}"
84
- msgstr "máximo es {}"
85
-
86
- #: sphinxcontrib/openapi/renderers/_model.py:43
87
- msgid "items must be unique"
88
- msgstr "los artículos deben ser únicos"
89
-
90
- #: sphinxcontrib/openapi/renderers/_model.py:45
91
- msgid "pattern ``{}``"
92
- msgstr "patrón ``{}``"
93
-
94
- #: sphinxcontrib/openapi/renderers/_model.py:47
95
- msgid "possible values are {}"
96
- msgstr "los valores posibles son {}"
97
-
98
- #: sphinxcontrib/openapi/renderers/_model.py:54
99
- msgid "read only"
100
- msgstr "sólo lectura"
101
-
102
- #: sphinxcontrib/openapi/renderers/_model.py:56
103
- msgid "write only"
104
- msgstr "escribir solamente"
105
-
106
- #: sphinxcontrib/openapi/renderers/_model.py:63
107
- #, fuzzy
108
- msgid "Constraints"
109
- msgstr "Restricciones"
110
-
111
- #: sphinxcontrib/openapi/renderers/_model.py:64
112
- msgid "Constraints: {}"
113
- msgstr "Restricciones: {}"
114
-
115
- #: sphinxcontrib/openapi/renderers/_model.py:77
116
- msgid "DEPRECATED"
117
- msgstr "OBSOLETO"
118
-
119
- #: sphinxcontrib/openapi/renderers/_model.py:144
120
- #: sphinxcontrib/openapi/renderers/_model.py:151
121
- #: sphinxcontrib/openapi/renderers/_model.py:178
122
- msgid "Array of {}"
123
- msgstr "Lista de {}"
124
-
125
- #: sphinxcontrib/openapi/renderers/_model.py:156
126
- msgid "Array"
127
- msgstr "Lista"
128
-
129
- #: sphinxcontrib/openapi/renderers/_model.py:197
130
- #: sphinxcontrib/openapi/renderers/_model.py:214
131
- msgid "One of {}"
132
- msgstr "Uno de {}"
133
-
134
- #: sphinxcontrib/openapi/renderers/_model.py:200
135
- #: sphinxcontrib/openapi/renderers/_model.py:222
136
- msgid "All of {}"
137
- msgstr "Todo de {}"
138
-
139
- #: sphinxcontrib/openapi/renderers/_model.py:203
140
- #: sphinxcontrib/openapi/renderers/_model.py:230
141
- msgid "Any of {}"
142
- msgstr "Cualquiera de {}"
143
-
144
- #: sphinxcontrib/openapi/renderers/_model.py:263
145
- msgid "Attribute"
146
- msgstr "Atributo"
147
-
148
- #: sphinxcontrib/openapi/renderers/_model.py:264
149
- msgid "Type"
150
- msgstr "Tipo"
151
-
152
- #: sphinxcontrib/openapi/renderers/_model.py:265
153
- msgid "Description"
154
- msgstr "Descripción"
155
-
156
- #: sphinxcontrib/openapi/renderers/_model.py:272
157
- msgid "N/A"
158
- msgstr "N/A"
159
-
160
- #: sphinxcontrib/openapi/renderers/_model.py:275
161
- msgid "Yes"
162
- msgstr "Si"
163
-
164
- #: sphinxcontrib/openapi/renderers/_model.py:283
165
- msgid "Example #{}:"
166
- msgstr "Ejemplo #{}"
167
-
168
- #: sphinxcontrib/openapi/renderers/_model.py:295
169
- msgid "Invalid example"
170
- msgstr "Ejemplo inválido"
1
+ # Spanish translations for PROJECT.
2
+ # Copyright (C) 2022 ORGANIZATION
3
+ # This file is distributed under the same license as the PROJECT project.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PROJECT VERSION\n"
9
+ "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
+ "POT-Creation-Date: 2022-04-23 02:37+0200\n"
11
+ "PO-Revision-Date: 2022-04-19 15:19+0200\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language: es\n"
14
+ "Language-Team: es <LL@li.org>\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1)\n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=utf-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Generated-By: Babel 2.9.1\n"
20
+
21
+ #: sphinxcontrib/openapi/openapi30.py:206
22
+ #: sphinxcontrib/openapi/openapi30.py:241
23
+ msgid "Example request"
24
+ msgstr "Ejemplo de solicitud"
25
+
26
+ #: sphinxcontrib/openapi/openapi30.py:237
27
+ msgid "Example response"
28
+ msgstr "Ejemplo de respuesta"
29
+
30
+ #: sphinxcontrib/openapi/openapi30.py:333
31
+ msgid "Scope required"
32
+ msgstr "Permiso"
33
+
34
+ #: sphinxcontrib/openapi/openapi30.py:344
35
+ msgid "Object of"
36
+ msgstr "Objeto de"
37
+
38
+ #: sphinxcontrib/openapi/openapi30.py:344
39
+ msgid "Array of"
40
+ msgstr "Lista de"
41
+
42
+ #: sphinxcontrib/openapi/openapi30.py:345
43
+ #: sphinxcontrib/openapi/renderers/_model.py:121
44
+ msgid "Object of type {}"
45
+ msgstr "Objeto de tipo {}"
46
+
47
+ #: sphinxcontrib/openapi/openapi30.py:349
48
+ #: sphinxcontrib/openapi/openapi30.py:359
49
+ #: sphinxcontrib/openapi/renderers/_model.py:190
50
+ msgid "Additional properties"
51
+ msgstr "Propiedades adicionales"
52
+
53
+ #: sphinxcontrib/openapi/openapi30.py:389
54
+ #: sphinxcontrib/openapi/renderers/_model.py:266
55
+ msgid "Required"
56
+ msgstr "Requerido"
57
+
58
+ #: sphinxcontrib/openapi/openapi30.py:408
59
+ msgid "Request body:"
60
+ msgstr "Cuerpo de la solicitud:"
61
+
62
+ #: sphinxcontrib/openapi/renderers/_model.py:31
63
+ msgid "minItems is {}"
64
+ msgstr "minItems es {}"
65
+
66
+ #: sphinxcontrib/openapi/renderers/_model.py:33
67
+ msgid "maxItems is {}"
68
+ msgstr "maxItems es {}"
69
+
70
+ #: sphinxcontrib/openapi/renderers/_model.py:35
71
+ msgid "minLength is {}"
72
+ msgstr "minLength es {}"
73
+
74
+ #: sphinxcontrib/openapi/renderers/_model.py:37
75
+ msgid "maxLength is {}"
76
+ msgstr "maxLength es {}"
77
+
78
+ #: sphinxcontrib/openapi/renderers/_model.py:39
79
+ msgid "minimum is {}"
80
+ msgstr "mínimo es {}"
81
+
82
+ #: sphinxcontrib/openapi/renderers/_model.py:41
83
+ msgid "maximum is {}"
84
+ msgstr "máximo es {}"
85
+
86
+ #: sphinxcontrib/openapi/renderers/_model.py:43
87
+ msgid "items must be unique"
88
+ msgstr "los artículos deben ser únicos"
89
+
90
+ #: sphinxcontrib/openapi/renderers/_model.py:45
91
+ msgid "pattern ``{}``"
92
+ msgstr "patrón ``{}``"
93
+
94
+ #: sphinxcontrib/openapi/renderers/_model.py:47
95
+ msgid "possible values are {}"
96
+ msgstr "los valores posibles son {}"
97
+
98
+ #: sphinxcontrib/openapi/renderers/_model.py:54
99
+ msgid "read only"
100
+ msgstr "sólo lectura"
101
+
102
+ #: sphinxcontrib/openapi/renderers/_model.py:56
103
+ msgid "write only"
104
+ msgstr "escribir solamente"
105
+
106
+ #: sphinxcontrib/openapi/renderers/_model.py:63
107
+ #, fuzzy
108
+ msgid "Constraints"
109
+ msgstr "Restricciones"
110
+
111
+ #: sphinxcontrib/openapi/renderers/_model.py:64
112
+ msgid "Constraints: {}"
113
+ msgstr "Restricciones: {}"
114
+
115
+ #: sphinxcontrib/openapi/renderers/_model.py:77
116
+ msgid "DEPRECATED"
117
+ msgstr "OBSOLETO"
118
+
119
+ #: sphinxcontrib/openapi/renderers/_model.py:144
120
+ #: sphinxcontrib/openapi/renderers/_model.py:151
121
+ #: sphinxcontrib/openapi/renderers/_model.py:178
122
+ msgid "Array of {}"
123
+ msgstr "Lista de {}"
124
+
125
+ #: sphinxcontrib/openapi/renderers/_model.py:156
126
+ msgid "Array"
127
+ msgstr "Lista"
128
+
129
+ #: sphinxcontrib/openapi/renderers/_model.py:197
130
+ #: sphinxcontrib/openapi/renderers/_model.py:214
131
+ msgid "One of {}"
132
+ msgstr "Uno de {}"
133
+
134
+ #: sphinxcontrib/openapi/renderers/_model.py:200
135
+ #: sphinxcontrib/openapi/renderers/_model.py:222
136
+ msgid "All of {}"
137
+ msgstr "Todo de {}"
138
+
139
+ #: sphinxcontrib/openapi/renderers/_model.py:203
140
+ #: sphinxcontrib/openapi/renderers/_model.py:230
141
+ msgid "Any of {}"
142
+ msgstr "Cualquiera de {}"
143
+
144
+ #: sphinxcontrib/openapi/renderers/_model.py:263
145
+ msgid "Attribute"
146
+ msgstr "Atributo"
147
+
148
+ #: sphinxcontrib/openapi/renderers/_model.py:264
149
+ msgid "Type"
150
+ msgstr "Tipo"
151
+
152
+ #: sphinxcontrib/openapi/renderers/_model.py:265
153
+ msgid "Description"
154
+ msgstr "Descripción"
155
+
156
+ #: sphinxcontrib/openapi/renderers/_model.py:272
157
+ msgid "N/A"
158
+ msgstr "N/A"
159
+
160
+ #: sphinxcontrib/openapi/renderers/_model.py:275
161
+ msgid "Yes"
162
+ msgstr "Si"
163
+
164
+ #: sphinxcontrib/openapi/renderers/_model.py:283
165
+ msgid "Example #{}:"
166
+ msgstr "Ejemplo #{}"
167
+
168
+ #: sphinxcontrib/openapi/renderers/_model.py:295
169
+ msgid "Invalid example"
170
+ msgstr "Ejemplo inválido"