-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combine model serialization logic for files and directories (#257)
* combine model serialization logic for files and directories Identical logic was being performed whether model_path pointed to a file or a directory due to two pathlib.Path.glob behaviors: 1. The path must be a directory for the generator to yield items 2. The glob does not include the provided directory itself. By iterating over the provided model_path first, and then continuing to the glob, all of the serialization logic can be done in the loop. This will help future changes which will add more serialization logic in the form of ignore paths. Signed-off-by: Spencer Schrock <sschrock@google.com> * avoid using an inner function to generate the root iterator Signed-off-by: Spencer Schrock <sschrock@google.com> --------- Signed-off-by: Spencer Schrock <sschrock@google.com>
- Loading branch information
1 parent
9798149
commit 8e54020
Showing
2 changed files
with
26 additions
and
32 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