Skip to content

Commit

Permalink
Improve cli dpi argument for stripes
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Jan 22, 2025
1 parent f54a74f commit af434e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ def test_stripes_values_target_not_matching_format(tmp_path):
def test_climate_stripes_target_wrong_dpi():
runner = CliRunner()
result = runner.invoke(cli, ["stripes", "values", "--kind=precipitation", "--station=1048", "--dpi=0"])
assert result.exit_code == 1
assert "Error: dpi must be more than 0" in result.stdout
assert result.exit_code == 2
assert "Error: Invalid value for '--dpi': 0 is not in the range x>0.\n" in result.stdout
2 changes: 1 addition & 1 deletion wetterdienst/ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ def stripes_stations(kind: str, active: bool, fmt: str, pretty: bool):
@cloup.option("--show_years", type=click.BOOL, default=True)
@cloup.option("--show_data_availability", type=click.BOOL, default=True)
@cloup.option("--format", "fmt", type=click.Choice(["png", "jpg", "svg", "pdf"], case_sensitive=False), default="png")
@cloup.option("--dpi", type=click.INT, default=300)
@cloup.option("--dpi", type=click.IntRange(min=0, min_open=True), default=300)
@cloup.option("--target", type=click.Path(dir_okay=False, path_type=Path))
@debug_opt
@cloup.constraint(
Expand Down

0 comments on commit af434e9

Please sign in to comment.