Added and switched to the Resource Manager

- Added Resource Manager
- Migrated most exts to it
- Added config entry for the resources URL
- Added my ID to template
- Bumped copyright on edited files

Fixes #246
This commit is contained in:
0x5c
2021-03-18 09:17:30 -04:00
parent 54960e8237
commit 0241d1856a
39 changed files with 302 additions and 1856 deletions
+52
View File
@@ -0,0 +1,52 @@
{
"title": "Index",
"type": "object",
"properties": {
"last_updated": {
"title": "Last Updated",
"type": "string",
"format": "date-time"
},
"resources": {
"title": "Resources",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Resource"
}
}
},
"required": [
"last_updated",
"resources"
],
"definitions": {
"File": {
"title": "File",
"type": "object",
"properties": {
"filename": {
"title": "Filename",
"type": "string"
},
"hash": {
"title": "Hash",
"type": "string"
}
},
"required": [
"filename",
"hash"
]
},
"Resource": {
"title": "Resource",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/File"
}
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
from pathlib import Path
from utils.resources_manager import ResourcesManager
path = Path("./data/resources")
url = "https://qrmresources.miaow.io/resources/"
versions = {
"bandcharts": "v1",
"img": "v1",
"maps": "v1",
"morse": "v1",
"phonetics": "v1",
"qcodes": "v1",
"funetics": "v1"
}
rm = ResourcesManager(path, url, versions)
print(rm.index)