Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacto(cleanup): fix some type hints and relative imports
Browse files Browse the repository at this point in the history
Guts committed Aug 30, 2024
1 parent bf19ba9 commit 59c88f7
Showing 4 changed files with 3 additions and 18 deletions.
4 changes: 0 additions & 4 deletions qgis_deployment_toolbelt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
#! python3 # noqa: E265

# submodules
from .__about__ import __version__ # noqa: F401
6 changes: 1 addition & 5 deletions qgis_deployment_toolbelt/cli.py
Original file line number Diff line number Diff line change
@@ -32,10 +32,6 @@
from qgis_deployment_toolbelt.commands.upgrade import parser_upgrade
from qgis_deployment_toolbelt.utils.journalizer import configure_logger

# #############################################################################
# ########## Globals ###############
# ##################################

# ############################################################################
# ########## FUNCTIONS ###########
# ################################
@@ -84,7 +80,7 @@ def add_common_arguments(
def set_default_subparser(
parser_to_update: argparse.ArgumentParser,
default_subparser_name: str,
args: list = None,
args: list | None = None,
):
"""Set a default subparser to a parent parser. Call after setup and just before
parse_args().
7 changes: 0 additions & 7 deletions qgis_deployment_toolbelt/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
#! python3 # noqa: E265

"""Common tools and helpers."""

# submodules
from .proxies import get_proxy_settings # noqa: E402 F401
from .str2bool import str2bool # noqa: E402 F401
4 changes: 2 additions & 2 deletions qgis_deployment_toolbelt/utils/journalizer.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
# ################################


def configure_logger(verbosity: int = 1, logfile: Path = None):
def configure_logger(verbosity: int = 1, logfile: None | Path | str = None):
"""Configure logging according to verbosity from CLI.
Args:
@@ -169,5 +169,5 @@ def get_logger_filepath() -> Path | None:
if hasattr(handler, "baseFilename"):
return Path(handler.baseFilename)

logger.warning("No file found in ay log handlers.")
logger.warning("No file found in any log handlers.")
return None

0 comments on commit 59c88f7

Please sign in to comment.