refactor: fix remaining code review issues on kabi-use
- _get_client: remove useless try/except that re-raised same error - verify_cookies: increase timeout from 3s to 5s - fetch_user: use _deep_get for URL extraction (consistent with _parse_user_result) - formatter: remove no-op tweets_to_json wrapper and unused import - _as_int/_as_float: filter.py now imports from config.py (dedup) - CLI read commands: extract _fetch_and_display() to dedup favorite/search/likes/list_timeline - _write_action: move load_config inside try block - auth.py: add PEP 8 blank line after logger
This commit is contained in:
@@ -7,8 +7,6 @@ from rich.console import Console
|
||||
from rich.panel import Panel
|
||||
from rich.table import Table
|
||||
|
||||
from .serialization import tweets_to_json as _tweets_to_json
|
||||
|
||||
|
||||
def format_number(n):
|
||||
# type: (int) -> str
|
||||
@@ -161,13 +159,6 @@ def print_filter_stats(original_count, filtered, console=None):
|
||||
" Score range: %.1f ~ %.1f" % (bottom_score, top_score)
|
||||
)
|
||||
|
||||
|
||||
def tweets_to_json(tweets):
|
||||
# type: (List[Tweet]) -> str
|
||||
"""Export tweets as JSON string."""
|
||||
return _tweets_to_json(tweets)
|
||||
|
||||
|
||||
def print_user_profile(user, console=None):
|
||||
# type: (UserProfile, Optional[Console]) -> None
|
||||
"""Print user profile as a rich panel."""
|
||||
|
||||
Reference in New Issue
Block a user