mirror of
https://github.com/miaowware/qrm2.git
synced 2026-06-05 07:24:48 -04:00
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:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user