refactor: remove all noinspections
This commit is contained in:
parent
d4d460a2a0
commit
029c57e257
3 changed files with 8 additions and 12 deletions
12
commands.py
12
commands.py
|
@ -78,14 +78,12 @@ async def info_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|||
]
|
||||
reply_markup = InlineKeyboardMarkup(keyboard)
|
||||
|
||||
# noinspection PyListCreation
|
||||
m = []
|
||||
m.append(f"ID: {html_parser.code(post_data['id'])}")
|
||||
m.append(
|
||||
m = [
|
||||
f"ID: {html_parser.code(post_data['id'])}",
|
||||
f"Uploader: {html_parser.hyperlink(uploader_data['name'],
|
||||
f"{app.protocol}://{app.hostname}/users/{post_data['uploader_id']}")} "
|
||||
f"{html_parser.hyperlink("»", f"{app.protocol}://{app.hostname}/posts?tags=user:{uploader_data['name']}")}"
|
||||
)
|
||||
f"{app.protocol}://{app.hostname}/users/{post_data['uploader_id']}")} "
|
||||
f"{html_parser.hyperlink("»", f"{app.protocol}://{app.hostname}/posts?tags=user:{uploader_data['name']}")}",
|
||||
]
|
||||
created_at = datetime.fromisoformat(post_data["created_at"])
|
||||
m.append(
|
||||
f"Date: {html_parser.hyperlink(
|
||||
|
|
|
@ -28,12 +28,11 @@ class _App:
|
|||
def __init__(self):
|
||||
self.name = _c.get("App", "Name")
|
||||
self.host = _c.get("App", "Host")
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
response = requests.get(f"http://{self.host}/status.json")
|
||||
response = requests.get(f"http://{self.host}/status.json", timeout=10)
|
||||
if response.status_code != 200:
|
||||
raise
|
||||
except:
|
||||
raise requests.exceptions.InvalidURL
|
||||
except requests.exceptions.RequestException:
|
||||
print("Unable validate App.Host in config.ini.")
|
||||
exit(1)
|
||||
self.hostname = _c.get("App", "HostName")
|
||||
|
|
|
@ -16,7 +16,6 @@ from config import *
|
|||
from extensions import humanize_tags_from_json, format_rating, get_json
|
||||
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
query = update.inline_query.query
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue