ovos-yaml-editor 0.1.0a1__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.
- ovos_yaml_editor/__init__.py +360 -0
- ovos_yaml_editor/version.py +10 -0
- ovos_yaml_editor-0.1.0a1.dist-info/METADATA +19 -0
- ovos_yaml_editor-0.1.0a1.dist-info/RECORD +8 -0
- ovos_yaml_editor-0.1.0a1.dist-info/WHEEL +5 -0
- ovos_yaml_editor-0.1.0a1.dist-info/entry_points.txt +2 -0
- ovos_yaml_editor-0.1.0a1.dist-info/licenses/LICENSE +203 -0
- ovos_yaml_editor-0.1.0a1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
import click
|
|
5
|
+
import yaml
|
|
6
|
+
from fastapi import FastAPI, Request, Response, Depends
|
|
7
|
+
from fastapi.responses import HTMLResponse, RedirectResponse
|
|
8
|
+
from fastapi.security import HTTPBasic, HTTPBasicCredentials
|
|
9
|
+
from ovos_config.config import Configuration, LocalConf, MycroftDefaultConfig
|
|
10
|
+
from ovos_config.locations import USER_CONFIG
|
|
11
|
+
|
|
12
|
+
from ovos_yaml_editor.version import VERSION_STR
|
|
13
|
+
|
|
14
|
+
app = FastAPI()
|
|
15
|
+
|
|
16
|
+
# Fetch username and password from environment variables
|
|
17
|
+
USER = os.getenv("EDITOR_USERNAME", "admin") # Default to "admin" if not set
|
|
18
|
+
PASSWORD = os.getenv("EDITOR_PASSWORD", "password") # Default to "password" if not set
|
|
19
|
+
|
|
20
|
+
security = HTTPBasic()
|
|
21
|
+
|
|
22
|
+
memory_config = Configuration()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def authenticate(credentials: HTTPBasicCredentials = Depends(security)):
|
|
26
|
+
"""Authenticate the user."""
|
|
27
|
+
if credentials.username == USER and credentials.password == PASSWORD:
|
|
28
|
+
return True
|
|
29
|
+
else:
|
|
30
|
+
return False
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@app.get("/", response_class=HTMLResponse)
|
|
34
|
+
async def get_editor(credentials: HTTPBasicCredentials = Depends(authenticate)):
|
|
35
|
+
"""Show the editor only if the user is authenticated."""
|
|
36
|
+
if not credentials:
|
|
37
|
+
return RedirectResponse(url="/login")
|
|
38
|
+
|
|
39
|
+
return """
|
|
40
|
+
<html>
|
|
41
|
+
<head>
|
|
42
|
+
<title>OpenVoiceOS Editor</title>
|
|
43
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css">
|
|
44
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
|
45
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/darcula.min.css">
|
|
46
|
+
<style>
|
|
47
|
+
body {
|
|
48
|
+
font-family: Arial, sans-serif;
|
|
49
|
+
margin: 0;
|
|
50
|
+
background-color: #1e1e1e;
|
|
51
|
+
color: #f1f1f1;
|
|
52
|
+
height: 100vh;
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
}
|
|
56
|
+
.header {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: 20px;
|
|
60
|
+
background-color: #333;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
}
|
|
63
|
+
.header img {
|
|
64
|
+
height: 40px;
|
|
65
|
+
margin-right: 10px;
|
|
66
|
+
}
|
|
67
|
+
.header h1 {
|
|
68
|
+
font-size: 24px;
|
|
69
|
+
margin: 0;
|
|
70
|
+
}
|
|
71
|
+
.button-container {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-start;
|
|
74
|
+
gap: 10px;
|
|
75
|
+
margin-bottom: 10px;
|
|
76
|
+
}
|
|
77
|
+
button {
|
|
78
|
+
padding: 10px 15px;
|
|
79
|
+
font-size: 16px;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
background-color: #d32f2f; /* Red buttons */
|
|
82
|
+
color: white;
|
|
83
|
+
border: none;
|
|
84
|
+
border-radius: 4px;
|
|
85
|
+
}
|
|
86
|
+
#tabs {
|
|
87
|
+
display: flex;
|
|
88
|
+
gap: 10px;
|
|
89
|
+
margin-bottom: 10px;
|
|
90
|
+
}
|
|
91
|
+
#tabs button {
|
|
92
|
+
padding: 10px 20px;
|
|
93
|
+
background-color: #333;
|
|
94
|
+
color: white;
|
|
95
|
+
border: 1px solid #ccc;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
#tabs button.active {
|
|
99
|
+
background-color: #4CAF50;
|
|
100
|
+
}
|
|
101
|
+
#editor {
|
|
102
|
+
flex-grow: 1;
|
|
103
|
+
border: 1px solid #ccc;
|
|
104
|
+
}
|
|
105
|
+
.CodeMirror {
|
|
106
|
+
background-color: #1e1e1e;
|
|
107
|
+
color: #f1f1f1;
|
|
108
|
+
height: 100%;
|
|
109
|
+
}
|
|
110
|
+
.CodeMirror-gutters {
|
|
111
|
+
background-color: #1e1e1e;
|
|
112
|
+
border-right: 1px solid #ccc;
|
|
113
|
+
}
|
|
114
|
+
footer {
|
|
115
|
+
background-color: #333;
|
|
116
|
+
color: #f1f1f1;
|
|
117
|
+
padding: 10px;
|
|
118
|
+
text-align: center;
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
}
|
|
121
|
+
footer a {
|
|
122
|
+
color: #4CAF50;
|
|
123
|
+
text-decoration: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button:disabled {
|
|
127
|
+
background-color: #d3d3d3; /* Light grey */
|
|
128
|
+
cursor: not-allowed;
|
|
129
|
+
}
|
|
130
|
+
.CodeMirror .cm-keyword {
|
|
131
|
+
color: #c586c0;
|
|
132
|
+
}
|
|
133
|
+
.CodeMirror .cm-string {
|
|
134
|
+
color: #ce9178;
|
|
135
|
+
}
|
|
136
|
+
.CodeMirror .cm-number {
|
|
137
|
+
color: #b5cea8;
|
|
138
|
+
}
|
|
139
|
+
.CodeMirror .cm-variable {
|
|
140
|
+
color: #9cdcfe;
|
|
141
|
+
}
|
|
142
|
+
.CodeMirror .cm-variable-2 {
|
|
143
|
+
color: #c586c0;
|
|
144
|
+
}
|
|
145
|
+
.CodeMirror .cm-variable-3 {
|
|
146
|
+
color: #9cdcfe;
|
|
147
|
+
}
|
|
148
|
+
.CodeMirror .cm-def {
|
|
149
|
+
color: #4ec9b0;
|
|
150
|
+
}
|
|
151
|
+
.CodeMirror .cm-comment {
|
|
152
|
+
color: #6a9955;
|
|
153
|
+
}
|
|
154
|
+
.CodeMirror .cm-error {
|
|
155
|
+
color: #f44747;
|
|
156
|
+
background-color: #ff000030;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
</style>
|
|
160
|
+
</head>
|
|
161
|
+
<body>
|
|
162
|
+
<div class="header">
|
|
163
|
+
<div>
|
|
164
|
+
<img src="https://www.openvoiceos.org/_next/static/media/logo.02220a9b.png" alt="OpenVoiceOS Logo">
|
|
165
|
+
<h1>OpenVoiceOS Config Editor</h1>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="button-container">
|
|
168
|
+
<button onclick="reloadConfig()"><i class="fas fa-sync-alt"></i> Reload</button>
|
|
169
|
+
<button onclick="saveConfig()" id="saveButton"><i class="fas fa-save"></i> Save</button>
|
|
170
|
+
<button onclick="resetConfig()"><i class="fas fa-undo"></i> Reset Config</button>
|
|
171
|
+
<button onclick="reportIssue()"><i class="fas fa-exclamation-circle"></i> Report Issue</button>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div id="tabs">
|
|
176
|
+
<button class="active" onclick="switchTab('yaml')">YAML</button>
|
|
177
|
+
<button onclick="switchTab('json')">JSON</button>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div id="editor"></div>
|
|
181
|
+
|
|
182
|
+
<footer>
|
|
183
|
+
<p>© 2025 OpenVoiceOS. <a href="https://github.com/OpenVoiceOS/ovos-yaml-editor">GitHub</a> | <a href="https://github.com/OpenVoiceOS/ovos-yaml-editor/blob/dev/LICENSE">Apache 2.0 License</a></p>
|
|
184
|
+
</footer>
|
|
185
|
+
|
|
186
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.js"></script>
|
|
187
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/yaml/yaml.min.js"></script>
|
|
188
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/javascript/javascript.min.js"></script>
|
|
189
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/javascript/json.min.js"></script>
|
|
190
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
|
|
191
|
+
<script>
|
|
192
|
+
|
|
193
|
+
let editor;
|
|
194
|
+
|
|
195
|
+
function initEditor(mode) {
|
|
196
|
+
editor = CodeMirror(document.getElementById('editor'), {
|
|
197
|
+
lineNumbers: true,
|
|
198
|
+
gutters: ["CodeMirror-linenumbers", "CodeMirror-lint-markers"],
|
|
199
|
+
mode: mode === 'yaml' ? "yaml" : { name: "javascript", json: true },
|
|
200
|
+
theme: "darcula",
|
|
201
|
+
tabSize: 2,
|
|
202
|
+
lint: true,
|
|
203
|
+
lintOnChange: true,
|
|
204
|
+
lintOptions: {
|
|
205
|
+
onUpdateLinting: (annotations, _, doc) => {
|
|
206
|
+
const errors = annotations.filter(a => a.severity === 'error');
|
|
207
|
+
console.log("Linting errors: ", errors); // Debugging line
|
|
208
|
+
if (errors.length > 0) {
|
|
209
|
+
document.getElementById('saveButton').disabled = true;
|
|
210
|
+
} else {
|
|
211
|
+
document.getElementById('saveButton').disabled = false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
function switchTab(tab) {
|
|
220
|
+
document.querySelectorAll("#tabs button").forEach(button => button.classList.remove("active"));
|
|
221
|
+
document.querySelector(`#tabs button:nth-child(${tab === 'yaml' ? 1 : 2})`).classList.add("active");
|
|
222
|
+
editor.setOption("mode", tab === 'yaml' ? "yaml" : "application/json");
|
|
223
|
+
reloadConfig(tab);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Fetch the current config and load it into the editor
|
|
227
|
+
async function reloadConfig() {
|
|
228
|
+
const format = editor.getOption("mode") === "yaml" ? "yaml" : "json";
|
|
229
|
+
const response = await fetch(`/config/${format}`);
|
|
230
|
+
const config = await response.text();
|
|
231
|
+
editor.setValue(config);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Save the content of the editor
|
|
235
|
+
async function saveConfig() {
|
|
236
|
+
const data = editor.getValue();
|
|
237
|
+
const format = editor.getOption("mode") === "yaml" ? "yaml" : "json";
|
|
238
|
+
const response = await fetch("/config", {
|
|
239
|
+
method: "POST",
|
|
240
|
+
headers: {
|
|
241
|
+
"Content-Type": "application/json"
|
|
242
|
+
},
|
|
243
|
+
body: JSON.stringify({ data: data, format: format })
|
|
244
|
+
});
|
|
245
|
+
const result = await response.json();
|
|
246
|
+
if (result.success) {
|
|
247
|
+
alert("Config saved successfully!");
|
|
248
|
+
} else {
|
|
249
|
+
alert("Error saving config: " + result.error);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async function resetConfig() {
|
|
254
|
+
if (!confirm("Are you sure you want to reset the config to default? This cannot be undone.")) return;
|
|
255
|
+
|
|
256
|
+
const response = await fetch("/config/reset", {
|
|
257
|
+
method: "POST"
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const result = await response.json();
|
|
261
|
+
if (result.success) {
|
|
262
|
+
alert("Config has been reset to default.");
|
|
263
|
+
reloadConfig(); // Refresh the editor with new config
|
|
264
|
+
} else {
|
|
265
|
+
alert("Error resetting config: " + result.error);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Report issue function
|
|
270
|
+
function reportIssue() {
|
|
271
|
+
window.open("https://github.com/OpenVoiceOS/ovos-yaml-editor/issues", "_blank");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Initialize the editor with YAML mode
|
|
275
|
+
window.onload = () => {
|
|
276
|
+
initEditor("yaml");
|
|
277
|
+
reloadConfig('yaml');
|
|
278
|
+
};
|
|
279
|
+
</script>
|
|
280
|
+
</body>
|
|
281
|
+
</html>
|
|
282
|
+
"""
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
# Endpoint to get the config as YAML or JSON based on the tab selected
|
|
286
|
+
@app.get("/config/{format}")
|
|
287
|
+
async def get_config(format: str, credentials: HTTPBasicCredentials = Depends(authenticate)):
|
|
288
|
+
if not credentials:
|
|
289
|
+
return RedirectResponse(url="/login")
|
|
290
|
+
if format == "json":
|
|
291
|
+
return Response(json.dumps(memory_config, indent=2, ensure_ascii=False), media_type="text/plain")
|
|
292
|
+
elif format == "yaml":
|
|
293
|
+
return Response(yaml.dump(dict(memory_config), default_flow_style=False, sort_keys=False), media_type="text/plain")
|
|
294
|
+
else:
|
|
295
|
+
return {"success": False, "error": "Unsupported format"}
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
@app.post("/config")
|
|
299
|
+
async def save_config_post(request: Request, credentials: HTTPBasicCredentials = Depends(authenticate)):
|
|
300
|
+
if not credentials:
|
|
301
|
+
return RedirectResponse(url="/login")
|
|
302
|
+
body = await request.json()
|
|
303
|
+
try:
|
|
304
|
+
data = body.get("data", "")
|
|
305
|
+
format = body.get("format", "yaml")
|
|
306
|
+
|
|
307
|
+
try:
|
|
308
|
+
if format == 'yaml':
|
|
309
|
+
data = yaml.safe_load(data)
|
|
310
|
+
else:
|
|
311
|
+
data = json.loads(data)
|
|
312
|
+
except Exception as e:
|
|
313
|
+
return {"success": False, "error": str(e)}
|
|
314
|
+
|
|
315
|
+
conf = LocalConf(USER_CONFIG)
|
|
316
|
+
default_conf = MycroftDefaultConfig()
|
|
317
|
+
for k, v in data.items():
|
|
318
|
+
v2 = default_conf.get(k)
|
|
319
|
+
# only save to file/memory any value that differs from default config
|
|
320
|
+
if v2 is None or v != v2:
|
|
321
|
+
conf[k] = memory_config[k] = v
|
|
322
|
+
# if value changed back to default, remove it from user conf
|
|
323
|
+
elif v == v2 and k in conf:
|
|
324
|
+
conf.pop(k)
|
|
325
|
+
conf.store()
|
|
326
|
+
return {"success": True}
|
|
327
|
+
except Exception as e:
|
|
328
|
+
return {"success": False, "error": f"Failed to save config: {e}"}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
@app.post("/config/reset")
|
|
332
|
+
async def reset_config_post(request: Request, credentials: HTTPBasicCredentials = Depends(authenticate)):
|
|
333
|
+
if not credentials:
|
|
334
|
+
return RedirectResponse(url="/login")
|
|
335
|
+
try:
|
|
336
|
+
conf = LocalConf(USER_CONFIG)
|
|
337
|
+
conf.clear()
|
|
338
|
+
conf.store()
|
|
339
|
+
memory_config.reset()
|
|
340
|
+
return {"success": True}
|
|
341
|
+
except Exception as e:
|
|
342
|
+
return {"success": False, "error": f"Failed to save config: {e}"}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
@app.post("/status")
|
|
346
|
+
async def status(request: Request):
|
|
347
|
+
return {"version": VERSION_STR}
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
@click.command()
|
|
351
|
+
@click.option('--host', default='127.0.0.1', help='Set to 0.0.0.0 to make externally accessible.')
|
|
352
|
+
@click.option('--port', default=9210, type=int, help='Port to run the app on.')
|
|
353
|
+
def main(host, port):
|
|
354
|
+
"""Run the OpenVoiceOS config editor Web UI."""
|
|
355
|
+
import uvicorn
|
|
356
|
+
uvicorn.run(app, host=host, port=port)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
if __name__ == "__main__":
|
|
360
|
+
main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ovos-yaml-editor
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Simple YAML editor for OpenVoiceOS with FastAPI backend
|
|
5
|
+
Home-page: https://github.com/OpenVoiceOS/ovos-yaml-editor
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: fastapi
|
|
11
|
+
Requires-Dist: pyyaml
|
|
12
|
+
Requires-Dist: uvicorn
|
|
13
|
+
Requires-Dist: ovos-config
|
|
14
|
+
Dynamic: classifier
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
Dynamic: requires-dist
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
Dynamic: summary
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ovos_yaml_editor/__init__.py,sha256=V4sqVQQX_Ek9x68OblXZGKIh_TNySxp_3fU8ETJxRIo,12358
|
|
2
|
+
ovos_yaml_editor/version.py,sha256=fPb0v9EVjtIeIQLoDqr4JinFHuiugpUYEOZ8mlmcaVg,236
|
|
3
|
+
ovos_yaml_editor-0.1.0a1.dist-info/licenses/LICENSE,sha256=5UnMsFEC8cZXbexGu4fwi7ZaVUonwJsLP3S9PCSQL_g,11343
|
|
4
|
+
ovos_yaml_editor-0.1.0a1.dist-info/METADATA,sha256=19zQKwIrhfPemG6BGRWaR0fe-ZbkG69LemXBRq4cEDU,547
|
|
5
|
+
ovos_yaml_editor-0.1.0a1.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
6
|
+
ovos_yaml_editor-0.1.0a1.dist-info/entry_points.txt,sha256=uTYj6XXGR24EOHeq5qvd-vELvv60xskZDLJeF_sL9Gc,59
|
|
7
|
+
ovos_yaml_editor-0.1.0a1.dist-info/top_level.txt,sha256=aN7ejEG-SsqfmLO1HvB86BZ05Nga1Qdo3PdMxJLPRag,17
|
|
8
|
+
ovos_yaml_editor-0.1.0a1.dist-info/RECORD,,
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2025 OpenVoiceOS
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ovos_yaml_editor
|