-
Notifications
You must be signed in to change notification settings - Fork 8
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
a6daf05
commit 8c45cdd
Showing
19 changed files
with
648 additions
and
148 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
from .cli import run_cli | ||
|
||
# This is the main entry point for the repopack command-line application. | ||
# It checks if the script is being run directly (not imported as a module) | ||
# and if so, it calls the run_cli function to start the CLI. | ||
|
||
if __name__ == "__main__": | ||
run_cli() | ||
run_cli() # type: ignore | ||
# Note: The type: ignore comment is added because run_cli is imported | ||
# from a local module and mypy might not be able to infer its type. |
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 |
---|---|---|
@@ -1,25 +1,56 @@ | ||
# file: exceptions.py | ||
|
||
from typing import Optional | ||
|
||
|
||
class RepopackError(Exception): | ||
"""Base exception class for Repopack errors.""" | ||
|
||
pass | ||
def __init__(self, message: Optional[str] = None) -> None: | ||
""" | ||
Initialize the RepopackError. | ||
Args: | ||
message (Optional[str]): The error message. Defaults to None. | ||
""" | ||
super().__init__(message) | ||
|
||
|
||
class ConfigurationError(RepopackError): | ||
"""Raised when there's an error in the configuration.""" | ||
|
||
pass | ||
def __init__(self, message: str) -> None: | ||
""" | ||
Initialize the ConfigurationError. | ||
Args: | ||
message (str): The specific configuration error message. | ||
""" | ||
super().__init__(f"Configuration error: {message}") | ||
|
||
|
||
class FileProcessingError(RepopackError): | ||
"""Raised when there's an error processing a file.""" | ||
|
||
pass | ||
def __init__(self, file_path: str, error_message: str) -> None: | ||
""" | ||
Initialize the FileProcessingError. | ||
Args: | ||
file_path (str): The path of the file that caused the error. | ||
error_message (str): The specific error message. | ||
""" | ||
super().__init__(f"Error processing file '{file_path}': {error_message}") | ||
|
||
|
||
class OutputGenerationError(RepopackError): | ||
"""Raised when there's an error generating the output.""" | ||
|
||
pass | ||
def __init__(self, error_message: str) -> None: | ||
""" | ||
Initialize the OutputGenerationError. | ||
Args: | ||
error_message (str): The specific error message related to output generation. | ||
""" | ||
super().__init__(f"Error generating output: {error_message}") |
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.