-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add logger; add main entry point
- Loading branch information
1 parent
2dbcde8
commit 3c02c64
Showing
4 changed files
with
70 additions
and
26 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
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,37 @@ | ||
import logging | ||
from typing import Tuple | ||
|
||
import click | ||
|
||
# Set up logging configuration | ||
logging.basicConfig( | ||
level=logging.INFO, | ||
format="- %(levelname)s - %(asctime)s: %(message)s", | ||
datefmt="%Y-%m-%d %H:%M:%S", | ||
) | ||
|
||
|
||
@click.command() | ||
@click.option( | ||
"--package1", | ||
nargs=2, | ||
type=(str, str), | ||
required=True, | ||
help="Provide the first package name alog with an architecture separated by whitespace. Example: --package1 package1_name arch_1", | ||
) | ||
@click.option( | ||
"--package2", | ||
nargs=2, | ||
type=(str, str), | ||
required=True, | ||
help="Provide the second package name alog with an architecture separated by whitespace. Example: --package2 package2_name arch_2", | ||
) | ||
def main(package1: Tuple[str, str], package2: Tuple[str, str]) -> None: | ||
package1_name, architecture1 = package1[0].lower(), package1[1].lower() | ||
package2_name, architecture2 = package2[0].lower(), package2[1].lower() | ||
logging.info(f"package1: {package1_name}, arch1: {architecture1}") | ||
logging.info(f"package2: {package2_name}, arch2: {architecture2}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |