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.
Files changed (46) hide show
  1. py2ls/.git/COMMIT_EDITMSG +1 -1
  2. py2ls/.git/FETCH_HEAD +1 -1
  3. py2ls/.git/index +0 -0
  4. py2ls/.git/logs/HEAD +1 -0
  5. py2ls/.git/logs/refs/heads/main +1 -0
  6. py2ls/.git/logs/refs/remotes/origin/HEAD +1 -0
  7. py2ls/.git/logs/refs/remotes/origin/main +1 -0
  8. py2ls/.git/objects/27/aa6074f652bc6f7078f8647489d9ee8e24f0e2 +0 -0
  9. py2ls/.git/objects/28/c2969d785c1b892c2a96b3f00eba63a59811b3 +0 -0
  10. py2ls/.git/objects/2a/fdf45791a26d42ccead35ace76a8f0b2a56561 +0 -0
  11. py2ls/.git/objects/34/b6f3a2ee84f39bed4eee57f2c0e0afb994feb1 +0 -0
  12. py2ls/.git/objects/35/1a5f491ab97eee9d1ee699478d75a8bb5d3dc2 +0 -0
  13. py2ls/.git/objects/39/b13be65125556784e44c7a1d9821703c7ab67e +0 -0
  14. py2ls/.git/objects/3b/507acc7f23391644cc0b824b1e79fd2677a362 +0 -0
  15. py2ls/.git/objects/3d/9d10d27724657a436c65a6254bfd213d4b3562 +0 -0
  16. py2ls/.git/objects/47/6cbd5a7c5e35cddef2f8a38bdc4896d403b095 +0 -0
  17. py2ls/.git/objects/78/063f4c863fc371ec0313303c0a81283b35d9b6 +0 -0
  18. py2ls/.git/objects/82/70b319ce4046854fbe7dc41054b6c2d112dab2 +0 -0
  19. py2ls/.git/objects/85/aee46f478e9afdb84d50a05242c53b04ed2e21 +0 -0
  20. py2ls/.git/objects/86/e288b46f8fe179907e4413f665aeb5053fddb1 +0 -0
  21. py2ls/.git/objects/94/f7dbe88e80c4205a901b71eb8f181974376bba +0 -0
  22. py2ls/.git/objects/9b/ec5ee2236ee2d5532c36bfd132e23c58fdb69c +0 -0
  23. py2ls/.git/objects/b3/4f7f271c6d6105e35a6556ffda71d03afe8c96 +0 -0
  24. py2ls/.git/objects/b3/69579064bde9de9a19d114fc33e4e48cc8c0e4 +0 -0
  25. py2ls/.git/objects/bf/b54d65922ce1dfda1aaa014913a54e7172d0bc +0 -0
  26. py2ls/.git/objects/c1/397c6ed72c4e20ef6b9ab83163e9a6baba5b45 +0 -0
  27. py2ls/.git/objects/cc/45df1d317a2eb63ff1ff3a5f3b4a9f98fd92b5 +0 -0
  28. py2ls/.git/objects/d6/39e8af592cd75a318d8affddd1bcc70c2095f2 +0 -0
  29. py2ls/.git/objects/db/3f2cd643292057936230b95cf7ec3046affe11 +0 -0
  30. py2ls/.git/objects/de/214c626ac2dd2685bfaa0bc0fc20f528d014d7 +0 -0
  31. py2ls/.git/objects/e4/6c715352db9fe3c887a635f1916df4ca1f4ff9 +0 -0
  32. py2ls/.git/objects/e5/0580a0bd1e1b3d29f834382b80fceb61d5cf0c +0 -0
  33. py2ls/.git/objects/ec/d980279432b13f0374b90ca439a6329cdece0f +0 -0
  34. py2ls/.git/objects/ee/cee64eacaff022dcdc509c0c2b1da492f21060 +0 -0
  35. py2ls/.git/objects/f5/61c3c1bf1c9ea9c9d1f556a7be2869f71f3bdf +0 -0
  36. py2ls/.git/refs/heads/main +1 -1
  37. py2ls/.git/refs/remotes/origin/main +1 -1
  38. py2ls/batman.py +62 -47
  39. py2ls/ips.py +771 -3
  40. py2ls/netfinder.py +125 -1
  41. py2ls/ocr.py +721 -0
  42. py2ls/plot.py +24 -0
  43. py2ls/translator.py +470 -119
  44. {py2ls-0.1.10.0.dist-info → py2ls-0.1.10.2.dist-info}/METADATA +1 -1
  45. {py2ls-0.1.10.0.dist-info → py2ls-0.1.10.2.dist-info}/RECORD +46 -17
  46. {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
- update
1
+ reg_update
py2ls/.git/FETCH_HEAD CHANGED
@@ -1 +1 @@
1
- 6dc2cdf4a84e538e5d4777486aeff87e42f41799 branch 'main' of https://github.com/Jianfengliu0413/py2ls
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
@@ -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
@@ -1 +1 @@
1
- 6dc2cdf4a84e538e5d4777486aeff87e42f41799
1
+ 86e288b46f8fe179907e4413f665aeb5053fddb1
@@ -1 +1 @@
1
- 6dc2cdf4a84e538e5d4777486aeff87e42f41799
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
- signature_styles = [
13
- "", # none
14
- (
15
- "------------------------------------------------------------------------------------------------\n"
16
- "Jianfeng Liu, PhD\n"
17
- "Institute of Medical Psychology and Behavioural Neurobiology\n"
18
- "University of Tübingen\n"
19
- "Otfried-Müller-Str. 25\n"
20
- "72076 Tübingen\n\n"
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
- signature = signature_styles[0]
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
- # config sender
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"] = email_address
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", f'attachment; filename= "{fname}"'
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(email_address, email_password)
117
- server.sendmail(email_address, who, message.as_string())
118
- print(f"Email successfully sent to {who}")
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
- # Schedule the job to run every minute
162
- schedule.every(1).minutes.do(example_job)
163
-
164
- while True:
165
- schedule.run_pending()
166
- time.sleep(1)
167
-
168
- # example2:
169
- email_to(
170
- who="Jianfeng.Liu@medizin.uni-tuebingen.de",
171
- subj="test",
172
- wha="this is the body",
173
- signat="\n\n Best, Jianfeng\n",
174
- att="/Users/macjianfeng/Dropbox/Downloads/_*_doc-xlsx/20240822-preprints_full_20190101_20201031-2.xlsx",
175
- )
176
- # example3:
177
- email_to(
178
- who="Jianfeng.Liu@medizin.uni-tuebingen.de",
179
- subj="test",
180
- wha="this is the test",
181
- signat=2,
182
- att="/Users/macjianfeng/Dropbox/Downloads/_*_doc-xlsx/20240822-preprints_full_20190101_20201031-2.xlsx",
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))