xenoslib 0.1.29.7__tar.gz → 0.1.29.9__tar.gz

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 (22) hide show
  1. {xenoslib-0.1.29.7/xenoslib.egg-info → xenoslib-0.1.29.9}/PKG-INFO +1 -1
  2. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/__init__.py +2 -0
  3. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/about.py +1 -1
  4. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/mail.py +8 -4
  5. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/win_trayicon.py +5 -4
  6. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9/xenoslib.egg-info}/PKG-INFO +1 -1
  7. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/LICENSE +0 -0
  8. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/README.md +0 -0
  9. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/setup.cfg +0 -0
  10. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/setup.py +0 -0
  11. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/__main__.py +0 -0
  12. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/base.py +0 -0
  13. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/dev.py +0 -0
  14. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/extend.py +0 -0
  15. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/linux.py +0 -0
  16. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/mock.py +0 -0
  17. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/onedrive.py +0 -0
  18. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib/windows.py +0 -0
  19. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib.egg-info/SOURCES.txt +0 -0
  20. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib.egg-info/dependency_links.txt +0 -0
  21. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib.egg-info/requires.txt +0 -0
  22. {xenoslib-0.1.29.7 → xenoslib-0.1.29.9}/xenoslib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xenoslib
3
- Version: 0.1.29.7
3
+ Version: 0.1.29.9
4
4
  Summary: Xenos' common lib
5
5
  Home-page: https://github.com/XenosLu/xenoslib.git
6
6
  Author: Xenocider
@@ -7,4 +7,6 @@ if sys.platform == "win32":
7
7
  from .win_trayicon import * # noqa
8
8
  elif sys.platform == "linux":
9
9
  from .linux import * # noqa
10
+ elif sys.platform == "darwin":
11
+ from .linux import * # noqa
10
12
  from .base import * # noqa
@@ -4,4 +4,4 @@ __url__ = "https://github.com/XenosLu/xenoslib.git"
4
4
  __author__ = "Xenocider"
5
5
  __author_email__ = "xenos.lu@gmail.com"
6
6
  __license__ = "MIT License"
7
- __version__ = "0.1.29.7"
7
+ __version__ = "0.1.29.9"
@@ -74,7 +74,10 @@ class MailFetcher:
74
74
  subject = str(email.header.make_header(email.header.decode_header(body["Subject"])))
75
75
  payload = body.get_payload(decode=True)
76
76
  if payload:
77
- payload = payload.decode()
77
+ try:
78
+ payload = payload.decode()
79
+ except UnicodeDecodeError:
80
+ payload = payload.decode("latin1") # failover decode
78
81
  body["raw"] = msg[b"BODY[]"]
79
82
  body["subjectx"] = subject
80
83
  body["payload"] = payload
@@ -158,9 +161,10 @@ def test_imap():
158
161
  mail_addr = os.environ["IMAP_ADDR"]
159
162
  mail_pwd = os.environ["IMAP_PASS"]
160
163
  for email_data in MailFetcher(
161
- imap_server, mail_addr, mail_pwd, interval=1, days=30, skip_current=True
164
+ imap_server, mail_addr, mail_pwd, interval=1, days=1, skip_current=False
162
165
  ):
163
166
  print(email_data["subject"])
167
+ print(email_data["subjectx"])
164
168
 
165
169
 
166
170
  def test():
@@ -179,5 +183,5 @@ def test():
179
183
 
180
184
 
181
185
  if __name__ == "__main__":
182
- # test_imap()
183
- test()
186
+ test_imap()
187
+ # ~ test()
@@ -85,15 +85,14 @@ class MenuItemConsole(MenuItem):
85
85
 
86
86
  def is_window_visible_not_minimized(self):
87
87
  """返回窗口是否可见且不处于最小化状态"""
88
- # 判断窗口是否可见
89
88
  visible = win32gui.IsWindowVisible(self.hconsole)
90
- # 判断窗口是否最小化
91
89
  minimized = win32gui.IsIconic(self.hconsole)
90
+ logger.debug(f"window visible: {visible}, window minimized: {minimized}")
92
91
  return visible and not minimized
93
92
 
94
93
  def action(self, show=None):
95
94
  if show is None:
96
- # super().action()'
95
+ # super().action()
97
96
  self.checked = not self.is_window_visible_not_minimized()
98
97
  # logger.info(self.checked)
99
98
  else:
@@ -101,7 +100,9 @@ class MenuItemConsole(MenuItem):
101
100
  win32gui.ShowWindow(self.hconsole, self.checked)
102
101
  if self.checked:
103
102
  try:
103
+ # win32gui.BringWindowToTop(self.hconsole)
104
104
  win32gui.SetForegroundWindow(self.hconsole)
105
+ # ctypes.windll.user32.SetForegroundWindow(self.hconsole)
105
106
  except Exception as exc:
106
107
  logger.debug(exc, exc_info=True)
107
108
 
@@ -121,7 +122,7 @@ class SysTrayIcon:
121
122
  if not iconpath:
122
123
  python_path = os.path.dirname(os.path.abspath(sys.executable))
123
124
  iconpath = os.path.join(python_path, "DLLs", "pyd.ico")
124
- logger.debug(iconpath)
125
+ logger.debug(f"Load icon from path: {iconpath}")
125
126
  if os.path.isfile(iconpath):
126
127
  hinst = win32gui.GetModuleHandle(None)
127
128
  icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xenoslib
3
- Version: 0.1.29.7
3
+ Version: 0.1.29.9
4
4
  Summary: Xenos' common lib
5
5
  Home-page: https://github.com/XenosLu/xenoslib.git
6
6
  Author: Xenocider
File without changes
File without changes
File without changes
File without changes
File without changes