feat(schema): make schema name configurable (closes #28) #32
Reference in New Issue
Block a user
Delete Branch "feat/configurable-schema-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Removes all hardcoded
"kindred-rd"schema references from the FreeCAD layer and makes the schema name configurable via FreeCAD preferences, environment variable, or the Settings dialog.Changes
silo-client submodule (PR: kindred/silo-client#15)
get_schema_name()toSiloSettingsbase class (default"kindred-rd", non-abstract)get_schema(),get_schema_form(),get_property_schema()now fall back tosettings.get_schema_name()instead of hardcodingget_property_schema()gains optionalcategoryquery parameterfreecad/silo_commands.py
CATEGORY_NAMES,get_category_folder_name,parse_part_number,sanitize_filename(deleted from upstream silo-client v0.2.0)_parse_part_number()and_sanitize_filename()defined locally; simplified folder naming to use category code directlyget_schema_name()toFreeCADSiloSettings— readsSchemaNamepref, falls back toSILO_SCHEMAenv var, then"kindred-rd"_get_schema_name()helper wrapperfreecad/schema_form.py
_fetch_properties(): replaced rawurllib.request(10 lines) withself._client.get_property_schema(category=category)_generate_pn_preview(): replaced rawurllib.request(12 lines) withself._client.generate_part_number()_on_create(): replaced"kindred-rd"literal with_get_schema_name()urllibimportsConfiguration Priority
SchemaName(set via Settings dialog)SILO_SCHEMAenvironment variable"kindred-rd"Verification
grep -rn "kindred-rd" freecad/returns only default values and UI hint textCloses #28