Skip to content

Commit 44bbf81

Browse files
committed
style(format): 🎨 format code with black 2024 style
1 parent ef128b0 commit 44bbf81

File tree

16 files changed

+28
-14
lines changed

16 files changed

+28
-14
lines changed

pytwitter/api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Api Impl
33
"""
4+
45
import base64
56
import logging
67
import os
@@ -448,9 +449,11 @@ def _get(
448449
data=data,
449450
includes=md.Includes.new_from_json_dict(includes),
450451
meta=md.Meta.new_from_json_dict(meta),
451-
errors=[md.Error.new_from_json_dict(err) for err in errors]
452-
if errors is not None
453-
else None,
452+
errors=(
453+
[md.Error.new_from_json_dict(err) for err in errors]
454+
if errors is not None
455+
else None
456+
),
454457
_json=resp_json,
455458
)
456459
return res

pytwitter/models/ext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Refer: https://developer.twitter.com/en/docs/twitter-api/expansions
55
"""
6+
67
from dataclasses import dataclass, field
78
from typing import List, Optional, Union
89

pytwitter/models/media.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ class MediaOrganicMetrics(MediaNonPublicMetrics):
2525

2626

2727
@dataclass
28-
class MediaPromotedMetrics(MediaOrganicMetrics):
29-
...
28+
class MediaPromotedMetrics(MediaOrganicMetrics): ...
3029

3130

3231
@dataclass

pytwitter/models/tweet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Refer: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
55
"""
6+
67
import textwrap
78
from dataclasses import dataclass, field
89
from typing import Optional, List
@@ -68,8 +69,7 @@ class TweetEntitiesHashtag(BaseModel):
6869

6970

7071
@dataclass
71-
class TweetEntitiesCashtag(TweetEntitiesHashtag):
72-
...
72+
class TweetEntitiesCashtag(TweetEntitiesHashtag): ...
7373

7474

7575
@dataclass
@@ -130,8 +130,7 @@ class TweetOrganicMetrics(TweetNonPublicMetrics):
130130

131131

132132
@dataclass
133-
class TweetPromotedMetrics(TweetOrganicMetrics):
134-
...
133+
class TweetPromotedMetrics(TweetOrganicMetrics): ...
135134

136135

137136
@dataclass

pytwitter/models/user.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class UserEntitiesHashtag(BaseModel):
2727

2828

2929
@dataclass
30-
class UserEntitiesMention(UserEntitiesHashtag):
31-
...
30+
class UserEntitiesMention(UserEntitiesHashtag): ...
3231

3332

3433
@dataclass

pytwitter/rate_limit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Refer: https://developer.twitter.com/en/docs/twitter-api/rate-limits
55
"""
6+
67
import logging
78
import re
89
from collections import defaultdict

pytwitter/streaming.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Api for streaming.
33
"""
4+
45
import base64
56
import json
67
import logging
@@ -378,7 +379,9 @@ def manage_rules(
378379
for item in resp_json.get("data", [])
379380
],
380381
meta=md.Meta.new_from_json_dict(resp_json.get("meta")),
381-
errors=[md.Error.new_from_json_dict(err) for err in errors]
382-
if errors
383-
else None,
382+
errors=(
383+
[md.Error.new_from_json_dict(err) for err in errors]
384+
if errors
385+
else None
386+
),
384387
)

pytwitter/utils/convertors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Parameter convertors
33
"""
4+
45
from pytwitter.error import PyTwitterError
56

67

pytwitter/utils/validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Parameters validators
33
"""
4+
45
from typing import List, Tuple, Union
56

67
from pytwitter.error import PyTwitterError

tests/apis/test_auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
tests for auth
33
"""
4+
45
import pytest
56
import responses
67

0 commit comments

Comments
 (0)