Skip to content

Commit

Permalink
style(black): 🎨 use black new 2024 stable style
Browse files Browse the repository at this point in the history
  • Loading branch information
MerleLiuKun committed Feb 4, 2024
1 parent d77ca38 commit 507c3e5
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 5 deletions.
1 change: 1 addition & 0 deletions pyyoutube/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
New Client for YouTube API
"""

import inspect
import json
from typing import List, Optional, Tuple, Union
Expand Down
7 changes: 4 additions & 3 deletions pyyoutube/media.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Media object to upload.
"""

import mimetypes
import os
from typing import IO, Optional, Tuple
Expand Down Expand Up @@ -180,9 +181,9 @@ def next_chunk(self) -> Tuple[Optional[MediaUploadProgress], Optional[dict]]:
# sending "bytes 0--1/0" results in an invalid request
# Only add header "Content-Range" if chunk_end != -1
if chunk_end != -1:
headers[
"Content-Range"
] = f"bytes {self.resumable_progress}-{chunk_end}/{size}"
headers["Content-Range"] = (
f"bytes {self.resumable_progress}-{chunk_end}/{size}"
)

resp = self.client.request(
path=self.resumable_uri,
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
These are category related models.
Include VideoCategory
"""

from dataclasses import dataclass, field
from typing import List, Optional

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
References: https://developers.google.com/youtube/v3/docs/channels#properties
"""

from dataclasses import dataclass, field
from typing import List, Optional

Expand Down
3 changes: 1 addition & 2 deletions pyyoutube/models/channel_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ class ChannelSectionResponse(BaseApiResponse):


@dataclass
class ChannelSectionListResponse(ChannelSectionResponse):
...
class ChannelSectionListResponse(ChannelSectionResponse): ...
1 change: 1 addition & 0 deletions pyyoutube/models/comment_thread.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are comment threads related models.
"""

from dataclasses import dataclass, field
from typing import Optional, List

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are common models for multi resource.
"""

from dataclasses import dataclass, field
from typing import Optional, List

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are some mixin for models
"""

import datetime
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/playlist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are playlist related models.
"""

from dataclasses import dataclass, field
from typing import Optional, List

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/search_result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are search result related models.
"""

from dataclasses import dataclass, field
from typing import Optional, List

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/models/video.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
These are video related models.
"""

from dataclasses import dataclass, field
from typing import Optional, List

Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/activities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Activities resource implementation
"""

from typing import Optional, Union

from pyyoutube.error import PyYouTubeException, ErrorMessage, ErrorCode
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/base_resource.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Base resource class.
"""

from typing import Optional, TYPE_CHECKING

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/captions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Captions resource implementation
"""

from typing import Optional, Union

from requests import Response
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/channel_banners.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Channel banners resource implementation.
"""

from typing import Optional

from pyyoutube.resources.base_resource import Resource
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/channels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Channel resource implementation.
"""

from typing import Optional, Union

from pyyoutube.error import PyYouTubeException, ErrorMessage, ErrorCode
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/comment_threads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Comment threads resource implementation.
"""

from typing import Optional, Union

from pyyoutube.error import PyYouTubeException, ErrorMessage, ErrorCode
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/membership_levels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Membership levels resource implementation.
"""

from typing import Optional, Union

from pyyoutube.models import MembershipsLevelListResponse
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Search resource implementation.
"""

from typing import Optional, Union

from pyyoutube.resources.base_resource import Resource
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/thumbnails.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Thumbnails resources implementation.
"""

from typing import Optional

from pyyoutube.resources.base_resource import Resource
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/video_abuse_report_reasons.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Video abuse report reasons resource implementation.
"""

from typing import Optional, Union

from pyyoutube.resources.base_resource import Resource
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/resources/watermarks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Watermarks resource implementation.
"""

from typing import Optional, Union

from pyyoutube.resources.base_resource import Resource
Expand Down
1 change: 1 addition & 0 deletions pyyoutube/utils/params_checker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
function's params checker.
"""

import logging

from typing import Optional, Union
Expand Down
1 change: 1 addition & 0 deletions tests/clients/test_captions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for captions resources.
"""

import io

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/clients/test_channel_banners.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for channel banners
"""

import io

from .base import BaseTestCase
Expand Down
1 change: 1 addition & 0 deletions tests/clients/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for client.
"""

import pytest

import responses
Expand Down
1 change: 1 addition & 0 deletions tests/clients/test_media.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for media upload.
"""

import io

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/clients/test_thumbnails.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for thumbnails.
"""

import io

from .base import BaseTestCase
Expand Down

0 comments on commit 507c3e5

Please sign in to comment.