-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a347eb6
commit 131c498
Showing
8 changed files
with
143 additions
and
69 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
version: 1 | ||
disable_existing_loggers: false | ||
formatters: | ||
console: | ||
format: "{asctime} {message}" | ||
style: "{" | ||
handlers: | ||
default: | ||
class: logging.StreamHandler | ||
formatter: console | ||
stream: ext://sys.stderr | ||
root: | ||
level: INFO | ||
propagate: true | ||
handlers: [default] |
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,24 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
from types import ModuleType | ||
|
||
if sys.version_info >= (3, 9): | ||
import importlib.resources as importlib_resources | ||
from importlib.abc import Traversable | ||
else: | ||
import importlib_resources | ||
from importlib_resources.abc import Traversable | ||
|
||
|
||
def get_package_files(package: str | ModuleType) -> Traversable: | ||
"""Load a file from a package. | ||
Args: | ||
package: The package to load the file from. | ||
file: The file to load. | ||
Returns: | ||
The file as a Traversable object. | ||
""" | ||
return importlib_resources.files(package) |
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