mirror of
https://github.com/paul-nameless/tg
synced 2024-11-12 23:37:13 +00:00
Fix code formatting
This commit is contained in:
parent
965045f714
commit
49981d1247
4 changed files with 9 additions and 8 deletions
3
setup.py
3
setup.py
|
@ -1,6 +1,7 @@
|
|||
import tg
|
||||
from setuptools import setup
|
||||
|
||||
import tg
|
||||
|
||||
with open("readme.md", "r") as fh:
|
||||
readme = fh.read()
|
||||
|
||||
|
|
|
@ -175,7 +175,9 @@ class Model:
|
|||
return False
|
||||
|
||||
def can_be_deleted(self, chat_id: int, msg: Dict[str, Any]) -> bool:
|
||||
c_id = msg["sender_id"].get("chat_id") or msg["sender_id"].get("user_id")
|
||||
c_id = msg["sender_id"].get("chat_id") or msg["sender_id"].get(
|
||||
"user_id"
|
||||
)
|
||||
if chat_id == c_id:
|
||||
return msg["can_be_deleted_only_for_self"]
|
||||
return msg["can_be_deleted_for_all_users"]
|
||||
|
|
|
@ -220,9 +220,9 @@ class MsgProxy:
|
|||
|
||||
@property
|
||||
def sender_id(self) -> int:
|
||||
return self.msg["sender_id"].get("user_id") or self.msg["sender_id"].get(
|
||||
"chat_id"
|
||||
)
|
||||
return self.msg["sender_id"].get("user_id") or self.msg[
|
||||
"sender_id"
|
||||
].get("chat_id")
|
||||
|
||||
@property
|
||||
def forward(self) -> Optional[Dict[str, Any]]:
|
||||
|
|
|
@ -85,9 +85,7 @@ def get_file_handler(file_path: str) -> str:
|
|||
return config.DEFAULT_OPEN.format(file_path=shlex.quote(file_path))
|
||||
|
||||
caps = get_mailcap()
|
||||
handler, view = mailcap.findmatch(
|
||||
caps, mtype, filename=file_path
|
||||
)
|
||||
handler, view = mailcap.findmatch(caps, mtype, filename=file_path)
|
||||
if not handler:
|
||||
return config.DEFAULT_OPEN.format(file_path=shlex.quote(file_path))
|
||||
return handler
|
||||
|
|
Loading…
Reference in a new issue