handle int/float in dl
This commit is contained in:
parent
8e078c97f5
commit
a874a6134e
2 changed files with 4 additions and 2 deletions
|
|
@ -134,11 +134,14 @@ class DownloadArgsParser:
|
||||||
|
|
||||||
next_dict[arg_name_split[-1]] = arg_value
|
next_dict[arg_name_split[-1]] = arg_value
|
||||||
|
|
||||||
# TODO: handle ints/floats
|
|
||||||
if arg_value == "True":
|
if arg_value == "True":
|
||||||
next_dict[arg_name_split[-1]] = True
|
next_dict[arg_name_split[-1]] = True
|
||||||
elif arg_value == "False":
|
elif arg_value == "False":
|
||||||
next_dict[arg_name_split[-1]] = False
|
next_dict[arg_name_split[-1]] = False
|
||||||
|
elif arg_value.isdigit():
|
||||||
|
next_dict[arg_name_split[-1]] = int(arg_value)
|
||||||
|
elif arg_value.replace(".", "", 1).isdigit():
|
||||||
|
next_dict[arg_name_split[-1]] = float(arg_value)
|
||||||
|
|
||||||
return argument_dict
|
return argument_dict
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import pytest
|
||||||
from ytdl_sub.cli.entrypoint import main
|
from ytdl_sub.cli.entrypoint import main
|
||||||
from ytdl_sub.subscriptions.subscription import Subscription
|
from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
from ytdl_sub.utils.file_handler import FileHandler
|
from ytdl_sub.utils.file_handler import FileHandler
|
||||||
from ytdl_sub.utils.system import IS_WINDOWS
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue