Skip to content

Commit

Permalink
Refacto: remove dead code (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts authored Dec 28, 2023
2 parents 2e15bb5 + db9370c commit 05399d9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 668 deletions.
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

0 comments on commit 05399d9

Please sign in to comment.