-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for setting target path in map config (#4694)
* Added support for setting addon target path in map config * Updated addon target path mapping to use dataclass * Added check before adding string folder maps * Moved enum to addon/const, updated map_volumes logic, fixed test * Removed log used for debugging * Use more readable approach to determine addon_config_used Co-authored-by: Mike Degatano <[email protected]> * Use cleaner approach for checking volume config Co-authored-by: Mike Degatano <[email protected]> * Use dict syntax and ATTR_TYPE Co-authored-by: Mike Degatano <[email protected]> * Use coerce for validating mapping type Co-authored-by: Mike Degatano <[email protected]> * Default read_only to true in schema Co-authored-by: Mike Degatano <[email protected]> * Use ATTR_TYPE and ATTR_READ_ONLY instead of static strings Co-authored-by: Mike Degatano <[email protected]> * Use constants instead of in-line strings Co-authored-by: Mike Degatano <[email protected]> * Correct type for path Co-authored-by: Mike Degatano <[email protected]> * Added read_only and path constants * Fixed small syntax error and added includes for constants * Simplify logic for handling string and dict entries in map config * Use ATTR_PATH instead of inline string Co-authored-by: Mike Degatano <[email protected]> * Add missing ATTR_PATH reference * Moved FolderMapping dataclass to data.py * Fix edge case where "data" map type is used but optional path is not set * Move FolderMapping dataclass to configuration.py to prevent circular reference --------- Co-authored-by: Jeff Oakley <[email protected]> Co-authored-by: Mike Degatano <[email protected]> Co-authored-by: Pascal Vizeli <[email protected]>
- Loading branch information
1 parent
2c09e79
commit e08c8ca
Showing
8 changed files
with
173 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Confgiuration Objects for Addon Config.""" | ||
|
||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass(slots=True) | ||
class FolderMapping: | ||
"""Represent folder mapping configuration.""" | ||
|
||
path: str | None | ||
read_only: bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.