Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refacto: remove dead code #368

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qgis_deployment_toolbelt/utils/check_image_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_svg_size(image_filepath: Path) -> tuple[int, int]:


def check_image_dimensions(
image_filepath: str | Path,
image_filepath: Path,
min_width: int = 500,
max_width: int = 600,
min_height: int = 250,
Expand All @@ -95,7 +95,7 @@ def check_image_dimensions(
) -> bool:
"""Check input image dimensions against passed limits.

:param Union[str, Path] image_filepath: path to the image to check
:param Path image_filepath: path to the image to check
:param int min_width: minimum width, defaults to 500
:param int max_width: maximum width, defaults to 600
:param int min_height: minimum height, defaults to 250
Expand Down
20 changes: 1 addition & 19 deletions qgis_deployment_toolbelt/utils/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import logging
from functools import lru_cache
from os import environ
from urllib.request import OpenerDirector, ProxyHandler, build_opener, getproxies
from urllib.request import getproxies

# package
from qgis_deployment_toolbelt.utils.url_helpers import check_str_is_url
Expand All @@ -30,24 +30,6 @@
# #############################################################################
# ########## Functions #############
# ##################################
@lru_cache
def get_proxy_handler() -> OpenerDirector:
"""Return URL opener with or without proxy handler.

Returns:
OpenerDirector: request handler supporting proxy settings
"""
# Handle network proxy
if get_proxy_settings() is not None:
proxy_handler = ProxyHandler(get_proxy_settings()) # Create a proxy handler
opener = build_opener(proxy_handler) # Create an opener that will use the proxy
else:
proxy_handler = ProxyHandler() # Create a proxy handler
opener = build_opener(proxy_handler) # Create an opener that will use the proxy

return opener


@lru_cache
def get_proxy_settings() -> dict:
"""Retrieves network proxy settings from operating system configuration or
Expand Down
Loading