Fix tuple typing to work on py 3.8

This commit is contained in:
Ivan Habunek 2024-04-24 08:10:56 +02:00
parent d777f0e98a
commit 6ed98fa4ef
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import logging
import platform import platform
import re import re
import sys import sys
from typing import Optional from typing import Optional, Tuple
import click import click
@ -255,7 +255,7 @@ def clips(
default=5, default=5,
) )
def download( def download(
ids: tuple[str, ...], ids: Tuple[str, ...],
auth_token: Optional[str], auth_token: Optional[str],
chapter: Optional[int], chapter: Optional[int],
concat: bool, concat: bool,
@ -374,7 +374,7 @@ def videos(
channel_name: str, channel_name: str,
all: bool, all: bool,
compact: bool, compact: bool,
games_tuple: tuple[str, ...], games_tuple: Tuple[str, ...],
json: bool, json: bool,
limit: Optional[int], limit: Optional[int],
pager: Optional[int], pager: Optional[int],

View File

@ -72,7 +72,7 @@ def video_info(video: Video, playlists, chapters: List[Chapter]):
print_table(["Placeholder", "Value"], placeholders) print_table(["Placeholder", "Value"], placeholders)
def video_json(video, playlists, chapters): def video_json(video: Video, playlists: str, chapters: List[Chapter]):
playlists = m3u8.loads(playlists).playlists playlists = m3u8.loads(playlists).playlists
video["playlists"] = [ video["playlists"] = [

View File

@ -3,7 +3,7 @@ Twitch API access.
""" """
import json import json
from typing import Dict, Generator, List, Literal, Mapping, Optional, TypedDict from typing import Dict, Generator, List, Literal, Mapping, Optional, Tuple, TypedDict
import click import click
import httpx import httpx
@ -345,7 +345,7 @@ def channel_videos_generator(
sort: VideosSort, sort: VideosSort,
type: VideosType, type: VideosType,
game_ids: Optional[List[str]] = None, game_ids: Optional[List[str]] = None,
) -> tuple[int, Generator[Video, None, None]]: ) -> Tuple[int, Generator[Video, None, None]]:
game_ids = game_ids or [] game_ids = game_ids or []
def _generator(videos: Data, max_videos: int) -> Generator[Video, None, None]: def _generator(videos: Data, max_videos: int) -> Generator[Video, None, None]: