Rubka 4.4.6__py3-none-any.whl → 4.4.8__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.
- rubka/adaptorrubka/network/socket.py +15 -8
- rubka/api.py +8 -5
- rubka-4.4.8.dist-info/METADATA +1019 -0
- {rubka-4.4.6.dist-info → rubka-4.4.8.dist-info}/RECORD +6 -6
- rubka-4.4.6.dist-info/METADATA +0 -315
- {rubka-4.4.6.dist-info → rubka-4.4.8.dist-info}/WHEEL +0 -0
- {rubka-4.4.6.dist-info → rubka-4.4.8.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import subprocess
|
|
1
3
|
|
|
2
|
-
|
|
3
|
-
from websocket import WebSocketApp
|
|
4
|
-
except:
|
|
5
|
-
import os
|
|
4
|
+
def install_and_import(package_name):
|
|
6
5
|
try:
|
|
7
|
-
|
|
8
|
-
except:
|
|
9
|
-
|
|
6
|
+
__import__(package_name)
|
|
7
|
+
except ModuleNotFoundError:
|
|
8
|
+
print(f"Module '{package_name}' not found. Installing...")
|
|
9
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
|
|
10
|
+
finally:
|
|
11
|
+
globals()[package_name] = __import__(package_name)
|
|
12
|
+
|
|
13
|
+
install_and_import("websocket")
|
|
14
|
+
|
|
15
|
+
from websocket import WebSocketApp
|
|
16
|
+
|
|
10
17
|
from .helper import Helper
|
|
11
18
|
from json import dumps, loads
|
|
12
19
|
from threading import Thread
|
|
@@ -21,4 +28,4 @@ class Socket:
|
|
|
21
28
|
self.methods = methods
|
|
22
29
|
self.handlers = {}
|
|
23
30
|
|
|
24
|
-
...
|
|
31
|
+
...
|
rubka/api.py
CHANGED
|
@@ -54,10 +54,13 @@ def check_rubka_version():
|
|
|
54
54
|
latest_version = get_latest_version(package_name)
|
|
55
55
|
if latest_version is None:return
|
|
56
56
|
if installed_version != latest_version:
|
|
57
|
-
print(f"\n\
|
|
58
|
-
print(f"Installed version: {installed_version}")
|
|
59
|
-
print(f"Latest version:
|
|
60
|
-
print(f"Please update
|
|
57
|
+
print(f"\n\nWARNING: Your installed version of '{package_name}' is OUTDATED and may cause errors or security risks!")
|
|
58
|
+
print(f"Installed version : {installed_version}")
|
|
59
|
+
print(f"Latest available version : {latest_version}")
|
|
60
|
+
print(f"Please update IMMEDIATELY by running:")
|
|
61
|
+
print(f"\npip install {package_name}=={latest_version}\n")
|
|
62
|
+
print(f"Not updating may lead to malfunctions or incompatibility.")
|
|
63
|
+
print(f"To see new methods : @rubka_library\n\n")
|
|
61
64
|
|
|
62
65
|
check_rubka_version()
|
|
63
66
|
def show_last_six_words(text):
|
|
@@ -621,7 +624,7 @@ class Robot:
|
|
|
621
624
|
inline_keypad: Dict[str, Any]
|
|
622
625
|
) -> Dict[str, Any]:
|
|
623
626
|
"""Edit inline keypad of a message."""
|
|
624
|
-
return self._post("
|
|
627
|
+
return self._post("editMessageKeypad", {
|
|
625
628
|
"chat_id": chat_id,
|
|
626
629
|
"message_id": message_id,
|
|
627
630
|
"inline_keypad": inline_keypad
|