py2ls 0.1.10.0__py3-none-any.whl → 0.1.10.2__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.
- py2ls/.git/COMMIT_EDITMSG +1 -1
- py2ls/.git/FETCH_HEAD +1 -1
- py2ls/.git/index +0 -0
- py2ls/.git/logs/HEAD +1 -0
- py2ls/.git/logs/refs/heads/main +1 -0
- py2ls/.git/logs/refs/remotes/origin/HEAD +1 -0
- py2ls/.git/logs/refs/remotes/origin/main +1 -0
- py2ls/.git/objects/27/aa6074f652bc6f7078f8647489d9ee8e24f0e2 +0 -0
- py2ls/.git/objects/28/c2969d785c1b892c2a96b3f00eba63a59811b3 +0 -0
- py2ls/.git/objects/2a/fdf45791a26d42ccead35ace76a8f0b2a56561 +0 -0
- py2ls/.git/objects/34/b6f3a2ee84f39bed4eee57f2c0e0afb994feb1 +0 -0
- py2ls/.git/objects/35/1a5f491ab97eee9d1ee699478d75a8bb5d3dc2 +0 -0
- py2ls/.git/objects/39/b13be65125556784e44c7a1d9821703c7ab67e +0 -0
- py2ls/.git/objects/3b/507acc7f23391644cc0b824b1e79fd2677a362 +0 -0
- py2ls/.git/objects/3d/9d10d27724657a436c65a6254bfd213d4b3562 +0 -0
- py2ls/.git/objects/47/6cbd5a7c5e35cddef2f8a38bdc4896d403b095 +0 -0
- py2ls/.git/objects/78/063f4c863fc371ec0313303c0a81283b35d9b6 +0 -0
- py2ls/.git/objects/82/70b319ce4046854fbe7dc41054b6c2d112dab2 +0 -0
- py2ls/.git/objects/85/aee46f478e9afdb84d50a05242c53b04ed2e21 +0 -0
- py2ls/.git/objects/86/e288b46f8fe179907e4413f665aeb5053fddb1 +0 -0
- py2ls/.git/objects/94/f7dbe88e80c4205a901b71eb8f181974376bba +0 -0
- py2ls/.git/objects/9b/ec5ee2236ee2d5532c36bfd132e23c58fdb69c +0 -0
- py2ls/.git/objects/b3/4f7f271c6d6105e35a6556ffda71d03afe8c96 +0 -0
- py2ls/.git/objects/b3/69579064bde9de9a19d114fc33e4e48cc8c0e4 +0 -0
- py2ls/.git/objects/bf/b54d65922ce1dfda1aaa014913a54e7172d0bc +0 -0
- py2ls/.git/objects/c1/397c6ed72c4e20ef6b9ab83163e9a6baba5b45 +0 -0
- py2ls/.git/objects/cc/45df1d317a2eb63ff1ff3a5f3b4a9f98fd92b5 +0 -0
- py2ls/.git/objects/d6/39e8af592cd75a318d8affddd1bcc70c2095f2 +0 -0
- py2ls/.git/objects/db/3f2cd643292057936230b95cf7ec3046affe11 +0 -0
- py2ls/.git/objects/de/214c626ac2dd2685bfaa0bc0fc20f528d014d7 +0 -0
- py2ls/.git/objects/e4/6c715352db9fe3c887a635f1916df4ca1f4ff9 +0 -0
- py2ls/.git/objects/e5/0580a0bd1e1b3d29f834382b80fceb61d5cf0c +0 -0
- py2ls/.git/objects/ec/d980279432b13f0374b90ca439a6329cdece0f +0 -0
- py2ls/.git/objects/ee/cee64eacaff022dcdc509c0c2b1da492f21060 +0 -0
- py2ls/.git/objects/f5/61c3c1bf1c9ea9c9d1f556a7be2869f71f3bdf +0 -0
- py2ls/.git/refs/heads/main +1 -1
- py2ls/.git/refs/remotes/origin/main +1 -1
- py2ls/batman.py +62 -47
- py2ls/ips.py +771 -3
- py2ls/netfinder.py +125 -1
- py2ls/ocr.py +721 -0
- py2ls/plot.py +24 -0
- py2ls/translator.py +470 -119
- {py2ls-0.1.10.0.dist-info → py2ls-0.1.10.2.dist-info}/METADATA +1 -1
- {py2ls-0.1.10.0.dist-info → py2ls-0.1.10.2.dist-info}/RECORD +46 -17
- {py2ls-0.1.10.0.dist-info → py2ls-0.1.10.2.dist-info}/WHEEL +1 -1
py2ls/.git/COMMIT_EDITMSG
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
reg_update
|
py2ls/.git/FETCH_HEAD
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
86e288b46f8fe179907e4413f665aeb5053fddb1 branch 'main' of https://github.com/Jianfengliu0413/py2ls
|
py2ls/.git/index
CHANGED
Binary file
|
py2ls/.git/logs/HEAD
CHANGED
@@ -19,3 +19,4 @@ d84688b54c0040a30976b3a6540bc47adf7ce680 32fd627b62fad7cf3b2f9e34ab9777126a0987a
|
|
19
19
|
1c3f92adda34344bcbbbf9d409c79855ae2aaea8 bf67907e337021ebff434e02b19b30a741c144af Jianfeng <Jianfeng.Liu0413@gmail.com> 1720948339 +0200 commit: update
|
20
20
|
bf67907e337021ebff434e02b19b30a741c144af a15389729850729fc7bd78a54f26fce77f30be12 Jianfeng <Jianfeng.Liu0413@gmail.com> 1721137352 +0200 commit: update ips
|
21
21
|
a15389729850729fc7bd78a54f26fce77f30be12 6dc2cdf4a84e538e5d4777486aeff87e42f41799 Jianfeng <Jianfeng.Liu0413@gmail.com> 1723527985 +0200 commit: update
|
22
|
+
6dc2cdf4a84e538e5d4777486aeff87e42f41799 86e288b46f8fe179907e4413f665aeb5053fddb1 Jianfeng <Jianfeng.Liu0413@gmail.com> 1725537214 +0200 commit: reg_update
|
py2ls/.git/logs/refs/heads/main
CHANGED
@@ -19,3 +19,4 @@ d84688b54c0040a30976b3a6540bc47adf7ce680 32fd627b62fad7cf3b2f9e34ab9777126a0987a
|
|
19
19
|
1c3f92adda34344bcbbbf9d409c79855ae2aaea8 bf67907e337021ebff434e02b19b30a741c144af Jianfeng <Jianfeng.Liu0413@gmail.com> 1720948339 +0200 commit: update
|
20
20
|
bf67907e337021ebff434e02b19b30a741c144af a15389729850729fc7bd78a54f26fce77f30be12 Jianfeng <Jianfeng.Liu0413@gmail.com> 1721137352 +0200 commit: update ips
|
21
21
|
a15389729850729fc7bd78a54f26fce77f30be12 6dc2cdf4a84e538e5d4777486aeff87e42f41799 Jianfeng <Jianfeng.Liu0413@gmail.com> 1723527985 +0200 commit: update
|
22
|
+
6dc2cdf4a84e538e5d4777486aeff87e42f41799 86e288b46f8fe179907e4413f665aeb5053fddb1 Jianfeng <Jianfeng.Liu0413@gmail.com> 1725537214 +0200 commit: reg_update
|
@@ -137,3 +137,4 @@ a15389729850729fc7bd78a54f26fce77f30be12 a15389729850729fc7bd78a54f26fce77f30be1
|
|
137
137
|
a15389729850729fc7bd78a54f26fce77f30be12 a15389729850729fc7bd78a54f26fce77f30be12 Jianfeng Liu <macjianfeng@JFLMBP.cin.medizin.uni-tuebingen.de> 1721326072 +0200 remote set-head
|
138
138
|
a15389729850729fc7bd78a54f26fce77f30be12 a15389729850729fc7bd78a54f26fce77f30be12 Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1723527981 +0200 remote set-head
|
139
139
|
6dc2cdf4a84e538e5d4777486aeff87e42f41799 6dc2cdf4a84e538e5d4777486aeff87e42f41799 Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1723527990 +0200 remote set-head
|
140
|
+
86e288b46f8fe179907e4413f665aeb5053fddb1 86e288b46f8fe179907e4413f665aeb5053fddb1 Jianfeng Liu <macjianfeng@JFLMBP.cin.medizin.uni-tuebingen.de> 1725537218 +0200 remote set-head
|
@@ -18,3 +18,4 @@ d84688b54c0040a30976b3a6540bc47adf7ce680 32fd627b62fad7cf3b2f9e34ab9777126a0987a
|
|
18
18
|
1c3f92adda34344bcbbbf9d409c79855ae2aaea8 bf67907e337021ebff434e02b19b30a741c144af Jianfeng <Jianfeng.Liu0413@gmail.com> 1720948342 +0200 update by push
|
19
19
|
bf67907e337021ebff434e02b19b30a741c144af a15389729850729fc7bd78a54f26fce77f30be12 Jianfeng <Jianfeng.Liu0413@gmail.com> 1721137354 +0200 update by push
|
20
20
|
a15389729850729fc7bd78a54f26fce77f30be12 6dc2cdf4a84e538e5d4777486aeff87e42f41799 Jianfeng <Jianfeng.Liu0413@gmail.com> 1723527989 +0200 update by push
|
21
|
+
6dc2cdf4a84e538e5d4777486aeff87e42f41799 86e288b46f8fe179907e4413f665aeb5053fddb1 Jianfeng <Jianfeng.Liu0413@gmail.com> 1725537218 +0200 update by push
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
py2ls/.git/refs/heads/main
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
86e288b46f8fe179907e4413f665aeb5053fddb1
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
86e288b46f8fe179907e4413f665aeb5053fddb1
|
py2ls/batman.py
CHANGED
@@ -7,20 +7,19 @@ import schedule
|
|
7
7
|
import time
|
8
8
|
from datetime import datetime
|
9
9
|
import os
|
10
|
+
from pprint import pp
|
11
|
+
import json
|
10
12
|
|
11
13
|
|
12
|
-
|
13
|
-
"",
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
),
|
22
|
-
f"Pappelweg 8\n72076 Tübingen\n\n",
|
23
|
-
]
|
14
|
+
def extract_kv(
|
15
|
+
dir_data="/Users/macjianfeng/Dropbox/github/python/py2ls/confidential_data/gmail_login.json",
|
16
|
+
idx=0,
|
17
|
+
): # select the index
|
18
|
+
with open(dir_data, "r") as file:
|
19
|
+
email_login = json.load(file)
|
20
|
+
for i, (user, pd) in enumerate(email_login.items()):
|
21
|
+
if i == idx:
|
22
|
+
return user, pd
|
24
23
|
|
25
24
|
|
26
25
|
def email_to(**kwargs):
|
@@ -40,7 +39,10 @@ def email_to(**kwargs):
|
|
40
39
|
who, what, subject = None, None, None
|
41
40
|
attachments = False
|
42
41
|
pause_sec = False # default 10 seconds pause
|
43
|
-
|
42
|
+
|
43
|
+
signature_styles = extract_kv(idx=1)[1] # signature list
|
44
|
+
signature = signature_styles[0] # default signature,None
|
45
|
+
verbose = True
|
44
46
|
|
45
47
|
# params config
|
46
48
|
for k, v in kwargs.items():
|
@@ -67,15 +69,14 @@ def email_to(**kwargs):
|
|
67
69
|
if any(["sig" in k.lower()]): # 'attachments', 'file'
|
68
70
|
signature = v # optional
|
69
71
|
if not isinstance(v, str):
|
72
|
+
print(signature_styles)
|
70
73
|
signature = signature_styles[v]
|
71
|
-
|
72
|
-
|
73
|
-
email_address = "andyandhope@gmail.com"
|
74
|
-
email_password = "myff ltls sfym wehe" # this is fake info
|
74
|
+
if any(["verb" in k.lower(), "show" in k.lower()]): # 'verbose', 'show'
|
75
|
+
verbose = v # verbose
|
75
76
|
|
76
77
|
# Create email message
|
77
78
|
message = MIMEMultipart()
|
78
|
-
message["From"] =
|
79
|
+
message["From"] = extract_kv()[0]
|
79
80
|
message["To"] = who
|
80
81
|
message["Subject"] = subject
|
81
82
|
|
@@ -97,10 +98,9 @@ def email_to(**kwargs):
|
|
97
98
|
part.set_payload(attachment.read())
|
98
99
|
encoders.encode_base64(part)
|
99
100
|
|
100
|
-
fname = os.path.basename(file)
|
101
|
-
print(fname)
|
102
101
|
part.add_header(
|
103
|
-
"Content-Disposition",
|
102
|
+
"Content-Disposition",
|
103
|
+
f'attachment; filename= "{os.path.basename(file)}"',
|
104
104
|
)
|
105
105
|
message.attach(part)
|
106
106
|
except FileNotFoundError:
|
@@ -109,13 +109,21 @@ def email_to(**kwargs):
|
|
109
109
|
print(f"Error attaching file {file}: {e}")
|
110
110
|
if pause_sec:
|
111
111
|
time.sleep(pause_sec)
|
112
|
+
|
112
113
|
# Send the email
|
113
114
|
try:
|
114
115
|
with smtplib.SMTP("smtp.gmail.com", 587) as server:
|
115
116
|
server.starttls()
|
116
|
-
server.login(
|
117
|
-
server.sendmail(
|
118
|
-
|
117
|
+
server.login(extract_kv()[0], extract_kv()[1])
|
118
|
+
server.sendmail(extract_kv()[0], who, message.as_string())
|
119
|
+
if verbose:
|
120
|
+
if attachments:
|
121
|
+
print(
|
122
|
+
f'\nEmail successfully sent to:\nto:"{who}"\nsubject:{subject}\nattached:'
|
123
|
+
)
|
124
|
+
pp(attachments)
|
125
|
+
else:
|
126
|
+
print(f'\nEmail successfully sent to:\nto:"{who}"\nsubject:{subject}')
|
119
127
|
except Exception as e:
|
120
128
|
print(f"Failed to send email: {e}")
|
121
129
|
|
@@ -158,26 +166,33 @@ def example_job():
|
|
158
166
|
|
159
167
|
|
160
168
|
if __name__ == "__main__":
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
#
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
169
|
+
pass
|
170
|
+
# # Schedule the job to run every minute
|
171
|
+
# schedule.every(1).minutes.do(example_job)
|
172
|
+
|
173
|
+
# while True:
|
174
|
+
# schedule.run_pending()
|
175
|
+
# time.sleep(1)
|
176
|
+
|
177
|
+
# # example2:
|
178
|
+
# email_to(
|
179
|
+
# who="Jianfeng.Liu@medizin.uni-tuebingen.de",
|
180
|
+
# subj="test",
|
181
|
+
# wha="this is the body",
|
182
|
+
# signat="\n\n Best, Jianfeng\n",
|
183
|
+
# att="/Users/macjianfeng/Dropbox/Downloads/_*_doc-xlsx/20240822-preprints_full_20190101_20201031-2.xlsx",
|
184
|
+
# )
|
185
|
+
|
186
|
+
# # example3:
|
187
|
+
# email_to(
|
188
|
+
# who="Jianfeng.Liu@medizin.uni-tuebingen.de",
|
189
|
+
# subj="test",
|
190
|
+
# wha="this is the test",
|
191
|
+
# signat=2,
|
192
|
+
# # att="/Users/macjianfeng/Dropbox/Downloads/_*_doc-xlsx/20240822-preprints_full_20190101_20201031-2.xlsx",
|
193
|
+
# )
|
194
|
+
|
195
|
+
# # example_4
|
196
|
+
# print(extract_kv(idx=0))
|
197
|
+
# print(extract_kv(idx=0)[0])
|
198
|
+
# print(extract_kv(idx=1))
|