Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jacalata committed Jan 10, 2025
1 parent f680997 commit 075f872
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ def apply_encoded_filter_value(logger, request_options, value):
# from apply_options, which expects an un-encoded input,
# or from apply_url_params via apply_encoded_filter_value which decodes the input
@staticmethod
def apply_filter_value(logger, request_options: TSC.PDFRequestOptions, value: str) -> None:
def apply_filter_value(logger, request_options: TSC.RequestOptions, value: str) -> None:
logger.debug("handling filter param {}".format(value))
data_filter = value.split("=")
request_options.vf(data_filter[0], data_filter[1])

# this is called from within from_url_params, for each param value
# expects either ImageRequestOptions or PDFRequestOptions
@staticmethod
def apply_options_in_url(logger, request_options: TSC.ImageRequestOptions, value: str) -> None:
def apply_options_in_url(logger, request_options: TSC.RequestOptions, value: str) -> None:
logger.debug("handling url option {}".format(value))
setting = value.split("=")
if len(setting) != 2:
Expand All @@ -115,7 +116,6 @@ def apply_options_in_url(logger, request_options: TSC.ImageRequestOptions, value
setting_val = setting[1]
logger.debug("setting named {}, has value {}".format(setting_name, setting_val))

# TODO: if the setting value ends with a filetype, read that and strip it
if ":iid" == setting_name:
logger.debug(":iid value ignored in url")
elif ":refresh" == setting_name and DatasourcesAndWorkbooks.is_truthy(setting_val):
Expand All @@ -126,8 +126,8 @@ def apply_options_in_url(logger, request_options: TSC.ImageRequestOptions, value
# this is only used by get as png
try:
height, width = setting_val.split(",")
request_options.viz_height = int(height)
request_options.viz_width = int(width)
(TSC.ImageRequestOptions(request_options)).viz_height = int(height)
(TSC.ImageRequestOptions(request_options)).viz_width = int(width)
except Exception as oops:
logger.warn("Unable to read image size options '{}', skipping".format(setting_val))
logger.warn(oops)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def run_command(args):
Errors.exit_with_error(logger, "Error saving to file", e)

@staticmethod
def apply_filters_from_args(request_options: TSC.PDFRequestOptions, args, logger=None) -> None:
def apply_filters_from_args(request_options: TSC.RequestOptions, args, logger=None) -> None:
if args.filter:
logger.debug("filter = {}".format(args.filter))
params = args.filter.split("&")
Expand Down

0 comments on commit 075f872

Please sign in to comment.