sticker-convert 2.13.3.0__py3-none-any.whl → 2.15.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. sticker_convert/auth/__init__.py +0 -0
  2. sticker_convert/auth/auth_base.py +19 -0
  3. sticker_convert/{utils/auth/get_discord_auth.py → auth/auth_discord.py} +40 -13
  4. sticker_convert/{utils/auth/get_kakao_auth.py → auth/auth_kakao_android_login.py} +80 -84
  5. sticker_convert/auth/auth_kakao_desktop_login.py +323 -0
  6. sticker_convert/{utils/auth/get_kakao_desktop_auth.py → auth/auth_kakao_desktop_memdump.py} +21 -12
  7. sticker_convert/{utils/auth/get_line_auth.py → auth/auth_line.py} +21 -6
  8. sticker_convert/{utils/auth/get_signal_auth.py → auth/auth_signal.py} +18 -20
  9. sticker_convert/auth/auth_telethon.py +151 -0
  10. sticker_convert/{utils/auth/get_viber_auth.py → auth/auth_viber.py} +19 -11
  11. sticker_convert/{utils/auth → auth}/telegram_api.py +10 -18
  12. sticker_convert/cli.py +57 -67
  13. sticker_convert/converter.py +4 -4
  14. sticker_convert/downloaders/download_line.py +2 -2
  15. sticker_convert/downloaders/download_telegram.py +1 -1
  16. sticker_convert/gui.py +20 -100
  17. sticker_convert/gui_components/frames/comp_frame.py +12 -4
  18. sticker_convert/gui_components/frames/config_frame.py +14 -6
  19. sticker_convert/gui_components/frames/control_frame.py +1 -1
  20. sticker_convert/gui_components/frames/cred_frame.py +6 -8
  21. sticker_convert/gui_components/windows/advanced_compression_window.py +3 -4
  22. sticker_convert/gui_components/windows/base_window.py +7 -2
  23. sticker_convert/gui_components/windows/discord_get_auth_window.py +3 -7
  24. sticker_convert/gui_components/windows/kakao_get_auth_window.py +272 -97
  25. sticker_convert/gui_components/windows/line_get_auth_window.py +5 -14
  26. sticker_convert/gui_components/windows/signal_get_auth_window.py +4 -12
  27. sticker_convert/gui_components/windows/viber_get_auth_window.py +8 -11
  28. sticker_convert/job.py +16 -32
  29. sticker_convert/job_option.py +1 -0
  30. sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  31. sticker_convert/resources/help.json +8 -6
  32. sticker_convert/uploaders/upload_telegram.py +1 -1
  33. sticker_convert/utils/callback.py +238 -6
  34. sticker_convert/version.py +1 -1
  35. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/METADATA +41 -42
  36. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/RECORD +40 -37
  37. sticker_convert/utils/auth/telethon_setup.py +0 -97
  38. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/WHEEL +0 -0
  39. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/entry_points.txt +0 -0
  40. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/licenses/LICENSE +0 -0
  41. {sticker_convert-2.13.3.0.dist-info → sticker_convert-2.15.0.0.dist-info}/top_level.txt +0 -0
@@ -21,7 +21,9 @@ class CompFrame(LabelFrame):
21
21
  self,
22
22
  text="?",
23
23
  width=1,
24
- command=lambda: self.gui.cb_msg_block(self.gui.help["comp"]["no_compress"]),
24
+ command=lambda: self.gui.cb.put(
25
+ ("msg_block", (self.gui.help["comp"]["no_compress"],), None)
26
+ ),
25
27
  bootstyle="secondary", # type: ignore
26
28
  )
27
29
  self.no_compress_lbl = Label(self, text="No compression")
@@ -38,7 +40,9 @@ class CompFrame(LabelFrame):
38
40
  self,
39
41
  text="?",
40
42
  width=1,
41
- command=lambda: self.gui.cb_msg_block(self.gui.help["comp"]["preset"]),
43
+ command=lambda: self.gui.cb.put(
44
+ ("msg_block", (self.gui.help["comp"]["preset"],), None)
45
+ ),
42
46
  bootstyle="secondary", # type: ignore
43
47
  )
44
48
  self.comp_preset_lbl = Label(self, text="Preset")
@@ -56,7 +60,9 @@ class CompFrame(LabelFrame):
56
60
  self,
57
61
  text="?",
58
62
  width=1,
59
- command=lambda: self.gui.cb_msg_block(self.gui.help["comp"]["steps"]),
63
+ command=lambda: self.gui.cb.put(
64
+ ("msg_block", (self.gui.help["comp"]["steps"],), None)
65
+ ),
60
66
  bootstyle="secondary", # type: ignore
61
67
  )
62
68
  self.steps_lbl = Label(self, text="Number of steps")
@@ -67,7 +73,9 @@ class CompFrame(LabelFrame):
67
73
  self,
68
74
  text="?",
69
75
  width=1,
70
- command=lambda: self.gui.cb_msg_block(self.gui.help["comp"]["processes"]),
76
+ command=lambda: self.gui.cb.put(
77
+ ("msg_block", (self.gui.help["comp"]["processes"],), None)
78
+ ),
71
79
  bootstyle="secondary", # type: ignore
72
80
  )
73
81
  self.processes_lbl = Label(self, text="Number of processes")
@@ -78,27 +78,35 @@ class ConfigFrame(LabelFrame):
78
78
  )
79
79
 
80
80
  def cb_clear_cred(self, *_: Any, **kwargs: Any) -> None:
81
- response = self.gui.cb_ask_bool("Are you sure you want to clear credentials?")
81
+ response = self.gui.cb.put(
82
+ ("ask_bool", ("Are you sure you want to clear credentials?",), None)
83
+ )
82
84
  if response is True:
83
85
  self.gui.delete_creds()
84
86
  self.gui.load_jsons()
85
87
  self.gui.apply_creds()
86
88
  self.gui.highlight_fields()
87
- self.gui.cb_msg_block("Credentials cleared.")
89
+ self.gui.cb.put(("msg_block", ("Credentials cleared.",), None))
88
90
 
89
91
  def cb_restore_default(self, *_: Any, **kwargs: Any) -> None:
90
- response = self.gui.cb_ask_bool(
91
- "Are you sure you want to restore default config? (This will not clear credentials.)"
92
+ response = self.gui.cb.put(
93
+ (
94
+ "ask_bool",
95
+ (
96
+ "Are you sure you want to restore default config? (This will not clear credentials.)",
97
+ ),
98
+ None,
99
+ )
92
100
  )
93
101
  if response is True:
94
102
  self.gui.delete_config()
95
103
  self.gui.load_jsons()
96
104
  self.gui.apply_config()
97
105
  self.gui.highlight_fields()
98
- self.gui.cb_msg_block("Restored to default config.")
106
+ self.gui.cb.put(("msg_block", ("Restored to default config.",), None))
99
107
 
100
108
  def cb_open_config_directory(self, *_: Any, **kwargs: Any) -> None:
101
- self.gui.cb_msg(msg=f"Config is located at {CONFIG_DIR}")
109
+ self.gui.cb.put(f"Config is located at {CONFIG_DIR}")
102
110
  if platform.system() == "Windows":
103
111
  os.startfile(CONFIG_DIR) # type: ignore
104
112
  elif platform.system() == "Darwin":
@@ -23,7 +23,7 @@ class ControlFrame(Frame):
23
23
 
24
24
  def cb_start_btn(self, *args: Any, **kwargs: Any) -> None:
25
25
  if self.gui.job:
26
- response = self.gui.cb_ask_bool("Cancel job?")
26
+ response = self.gui.cb.ask_bool("Cancel job?")
27
27
  if response is True:
28
28
  self.gui.cancel_job()
29
29
  else:
@@ -4,13 +4,13 @@ from typing import TYPE_CHECKING, Any
4
4
 
5
5
  from ttkbootstrap import Button, Entry, Label, LabelFrame # type: ignore
6
6
 
7
+ from sticker_convert.auth.auth_telethon import AuthTelethon
7
8
  from sticker_convert.gui_components.frames.right_clicker import RightClicker
8
9
  from sticker_convert.gui_components.windows.discord_get_auth_window import DiscordGetAuthWindow
9
10
  from sticker_convert.gui_components.windows.kakao_get_auth_window import KakaoGetAuthWindow
10
11
  from sticker_convert.gui_components.windows.line_get_auth_window import LineGetAuthWindow
11
12
  from sticker_convert.gui_components.windows.signal_get_auth_window import SignalGetAuthWindow
12
13
  from sticker_convert.gui_components.windows.viber_get_auth_window import ViberGetAuthWindow
13
- from sticker_convert.utils.auth.telethon_setup import TelethonSetup
14
14
 
15
15
  if TYPE_CHECKING:
16
16
  from sticker_convert.gui import GUI # type: ignore
@@ -188,19 +188,17 @@ class CredFrame(LabelFrame):
188
188
  faq_site = "https://github.com/laggykiller/sticker-convert#faq"
189
189
  success = webbrowser.open(faq_site)
190
190
  if not success:
191
- self.gui.cb_ask_str("You can get help from:", initialvalue=faq_site)
191
+ self.gui.cb.ask_str("You can get help from:", initialvalue=faq_site)
192
192
 
193
193
  def cb_telethon_get_auth(self, *_: Any) -> None:
194
- success, _client, api_id, api_hash = TelethonSetup(
195
- self.gui.get_opt_cred(), self.gui.cb_ask_str
196
- ).start()
194
+ success, _client, api_id, api_hash, msg = AuthTelethon(
195
+ self.gui.get_opt_cred(), self.gui.cb
196
+ ).start(check_auth_only=True)
197
197
  if success:
198
198
  self.gui.telethon_api_id_var.set(api_id)
199
199
  self.gui.telethon_api_hash_var.set(api_hash)
200
200
  self.gui.save_creds()
201
- self.gui.cb_msg_block("Telethon setup successful")
202
- else:
203
- self.gui.cb_msg_block("Telethon setup failed")
201
+ self.gui.cb.put(("msg_block", (msg,), None))
204
202
 
205
203
  def cb_kakao_get_auth(self, *_: Any) -> None:
206
204
  KakaoGetAuthWindow(self.gui)
@@ -2,7 +2,6 @@
2
2
  from __future__ import annotations
3
3
 
4
4
  import re
5
- from functools import partial
6
5
  from tkinter import colorchooser
7
6
  from typing import Any, List, Tuple
8
7
 
@@ -650,13 +649,13 @@ class AdvancedCompressionWindow(BaseWindow):
650
649
  self.set_emoji_btn()
651
650
 
652
651
  def add_help_btn(self, msg: str) -> Button:
653
- cb_msg_block_adv_comp_win = partial(self.gui.cb_msg_block, parent=self)
654
-
655
652
  return Button(
656
653
  self.frame_advcomp,
657
654
  text="?",
658
655
  width=1,
659
- command=lambda: cb_msg_block_adv_comp_win(msg),
656
+ command=lambda: self.gui.cb.put(
657
+ ("msg_block", None, {"message": msg, "parent": self})
658
+ ),
660
659
  bootstyle="secondary", # type: ignore
661
660
  )
662
661
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  import platform
3
- from typing import TYPE_CHECKING, Tuple
3
+ from typing import TYPE_CHECKING, Optional, Tuple
4
4
 
5
5
  from ttkbootstrap import Toplevel # type: ignore
6
6
 
@@ -11,10 +11,15 @@ if TYPE_CHECKING:
11
11
 
12
12
 
13
13
  class BaseWindow(Toplevel):
14
- def __init__(self, gui: "GUI") -> None:
14
+ def __init__(self, gui: "GUI", parent: Optional[Toplevel] = None) -> None:
15
15
  super().__init__(alpha=0) # type: ignore
16
16
  self.gui = gui
17
17
 
18
+ if parent is None:
19
+ self.parent = gui
20
+ else:
21
+ self.parent = parent
22
+
18
23
  GUIUtils.set_icon(self)
19
24
 
20
25
  self.mousewheel: Tuple[str, ...]
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env python3
2
- from functools import partial
3
2
  from threading import Thread
4
3
  from typing import Any
5
4
 
6
5
  from ttkbootstrap import Button, Frame, Label # type: ignore
7
6
 
7
+ from sticker_convert.auth.auth_discord import AuthDiscord
8
8
  from sticker_convert.gui_components.gui_utils import GUIUtils
9
9
  from sticker_convert.gui_components.windows.base_window import BaseWindow
10
- from sticker_convert.utils.auth.get_discord_auth import GetDiscordAuth
11
10
 
12
11
 
13
12
  class DiscordGetAuthWindow(BaseWindow):
@@ -16,9 +15,6 @@ class DiscordGetAuthWindow(BaseWindow):
16
15
 
17
16
  self.title("Get Discord token")
18
17
 
19
- self.cb_msg_block_discord = partial(self.gui.cb_msg_block, parent=self)
20
- self.cb_ask_str_discord = partial(self.gui.cb_ask_str, parent=self)
21
-
22
18
  self.frame_info = Frame(self.scrollable_frame)
23
19
  self.frame_start_btn = Frame(self.scrollable_frame)
24
20
 
@@ -68,7 +64,7 @@ class DiscordGetAuthWindow(BaseWindow):
68
64
  Thread(target=self.cb_login_thread, daemon=True).start()
69
65
 
70
66
  def cb_login_thread(self, *args: Any) -> None:
71
- m = GetDiscordAuth(cb_msg=self.gui.cb_msg)
67
+ m = AuthDiscord(self.gui.get_opt_cred(), self.gui.cb)
72
68
  discord_token, msg = m.get_cred()
73
69
  if discord_token:
74
70
  if not self.gui.creds.get("discord"):
@@ -79,4 +75,4 @@ class DiscordGetAuthWindow(BaseWindow):
79
75
  self.gui.save_creds()
80
76
  self.gui.highlight_fields()
81
77
 
82
- self.cb_msg_block_discord(msg)
78
+ self.gui.cb.put(("msg_block", None, {"message": msg, "parent": self}))