PyPtt 1.3.1__tar.gz → 1.3.3__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 (53) hide show
  1. {pyptt-1.3.1 → pyptt-1.3.3}/PKG-INFO +3 -2
  2. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/__init__.py +1 -1
  3. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_newest_index.py +2 -1
  4. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_mail.py +2 -0
  5. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/connect_core.py +11 -15
  6. pyptt-1.3.3/PyPtt/ssl_config.py +24 -0
  7. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt.egg-info/PKG-INFO +3 -2
  8. {pyptt-1.3.1 → pyptt-1.3.3}/README.md +1 -1
  9. {pyptt-1.3.1 → pyptt-1.3.3}/setup.py +1 -0
  10. pyptt-1.3.1/PyPtt/ssl_config.py +0 -24
  11. {pyptt-1.3.1 → pyptt-1.3.3}/LICENSE +0 -0
  12. {pyptt-1.3.1 → pyptt-1.3.3}/MANIFEST.in +0 -0
  13. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/PTT.py +0 -0
  14. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_bucket.py +0 -0
  15. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_call_status.py +0 -0
  16. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_change_pw.py +0 -0
  17. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_comment.py +0 -0
  18. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_del_post.py +0 -0
  19. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_board_info.py +0 -0
  20. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_board_list.py +0 -0
  21. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_bottom_post_list.py +0 -0
  22. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_favourite_board.py +0 -0
  23. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_post.py +0 -0
  24. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_post_index.py +0 -0
  25. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_post_list.py +0 -0
  26. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_time.py +0 -0
  27. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_get_user.py +0 -0
  28. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_give_money.py +0 -0
  29. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_has_new_mail.py +0 -0
  30. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_loginout.py +0 -0
  31. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_mark_post.py +0 -0
  32. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_post.py +0 -0
  33. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_reply_post.py +0 -0
  34. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_search_user.py +0 -0
  35. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_set_board_title.py +0 -0
  36. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/_api_util.py +0 -0
  37. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/check_value.py +0 -0
  38. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/command.py +0 -0
  39. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/config.py +0 -0
  40. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/data_type.py +0 -0
  41. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/exceptions.py +0 -0
  42. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/i18n.py +0 -0
  43. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/lang_en_US.py +0 -0
  44. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/lang_zh_TW.py +0 -0
  45. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/lib_util.py +0 -0
  46. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/log.py +0 -0
  47. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/screens.py +0 -0
  48. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt/service.py +0 -0
  49. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt.egg-info/SOURCES.txt +0 -0
  50. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt.egg-info/dependency_links.txt +0 -0
  51. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt.egg-info/requires.txt +0 -0
  52. {pyptt-1.3.1 → pyptt-1.3.3}/PyPtt.egg-info/top_level.txt +0 -0
  53. {pyptt-1.3.1 → pyptt-1.3.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPtt
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: PyPtt
5
5
  Home-page: https://pyptt.cc/
6
6
  Author: CodingMan
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Programming Language :: Python :: 3 :: Only
22
23
  Classifier: Natural Language :: Chinese (Traditional)
23
24
  Classifier: Natural Language :: English
@@ -64,7 +65,7 @@ PyPtt 是一套以 Pure Python 實作的 PTT (批踢踢) SDK,提供了完整
64
65
  - 其他功能: 即時訊息(水球)、P幣轉帳
65
66
 
66
67
  ### 系統需求
67
- - Python 3.6+
68
+ - Python 3.8 以上
68
69
  - 非雲端環境 (因 PTT 封鎖雲端 IP)
69
70
 
70
71
  ### 快速開始
@@ -1,4 +1,4 @@
1
- __version__ = '1.3.1'
1
+ __version__ = '1.3.3'
2
2
 
3
3
  from .PTT import API
4
4
  from .data_type import *
@@ -159,6 +159,7 @@ def get_newest_index(api, index_type: data_type.NewIndex, board: Optional[str] =
159
159
 
160
160
  target_list = [
161
161
  connect_core.TargetUnit(screens.Target.InMailBox, break_detect=True),
162
+ connect_core.TargetUnit(screens.Target.InMailBoxWithCursor, break_detect=True),
162
163
  connect_core.TargetUnit(screens.Target.CursorToGoodbye, response=cmd),
163
164
  ]
164
165
 
@@ -185,7 +186,7 @@ def get_newest_index(api, index_type: data_type.NewIndex, board: Optional[str] =
185
186
  cmd,
186
187
  target_list)
187
188
 
188
- if index == 0:
189
+ if index == 0 or index == 1:
189
190
  normal_newest_index = get_index(api)
190
191
 
191
192
  if search_list is not None and len(search_list) > 0:
@@ -47,6 +47,8 @@ def mail(api,
47
47
  if sign_file.lower() != 'x':
48
48
  raise exceptions.ParameterError(f'wrong parameter sign_file: {sign_file}')
49
49
 
50
+ content = lib_util.uniform_new_line(content)
51
+
50
52
  cmd_list = []
51
53
  # 回到主選單
52
54
  cmd_list.append(command.go_main_menu)
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import os.path
5
5
  import ssl
6
- import telnetlib
7
6
  import tempfile
8
7
  import threading
9
8
  import time
@@ -213,20 +212,17 @@ class API(object):
213
212
  for _ in range(2):
214
213
 
215
214
  try:
216
- if self.config.connect_mode == data_type.ConnectMode.TELNET:
217
- self._core = telnetlib.Telnet(telnet_host, self.config.port)
218
- else:
219
- if threading.current_thread() is not threading.main_thread():
220
- loop = asyncio.new_event_loop()
221
- asyncio.set_event_loop(loop)
222
-
223
- log.logger.debug('USER_AGENT',
224
- websockets.http11.USER_AGENT if use_http11 else websockets.http.USER_AGENT)
225
- self._core = asyncio.get_event_loop().run_until_complete(
226
- websockets.connect(
227
- websocket_host,
228
- origin=websocket_origin,
229
- ssl=ssl_context))
215
+ if threading.current_thread() is not threading.main_thread():
216
+ loop = asyncio.new_event_loop()
217
+ asyncio.set_event_loop(loop)
218
+
219
+ log.logger.debug('USER_AGENT',
220
+ websockets.http11.USER_AGENT if use_http11 else websockets.http.USER_AGENT)
221
+ self._core = asyncio.get_event_loop().run_until_complete(
222
+ websockets.connect(
223
+ websocket_host,
224
+ origin=websocket_origin,
225
+ ssl=ssl_context))
230
226
 
231
227
  connect_success = True
232
228
  except Exception as e:
@@ -0,0 +1,24 @@
1
+ key = """-----BEGIN EC PARAMETERS-----
2
+ BggqhkjOPQMBBw==
3
+ -----END EC PARAMETERS-----
4
+ -----BEGIN EC PRIVATE KEY-----
5
+ MHcCAQEEIDsVaXxAeTEqnC3V2BjBZepjfx3lG0UNiBb6IGs1nqo5oAoGCCqGSM49
6
+ AwEHoUQDQgAExzhLL99T9DDmDW8my+dVvremZ3lYo9l+D6sBkcaD+KxYkd+eHhCp
7
+ DBfIKnDILG7XNOpl3PBa4AOC4BkGkrqq0w==
8
+ -----END EC PRIVATE KEY-----
9
+ """
10
+
11
+ cert = """-----BEGIN CERTIFICATE-----
12
+ MIIB6TCCAY8CFAIPufXDoRbmCDs53mUkr/QCZ1wnMAoGCCqGSM49BAMCMHcxCzAJ
13
+ BgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0eTEVMBMGA1UE
14
+ CgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25hbCBVbml0MRQw
15
+ EgYDVQQDDAtDb21tb24gTmFtZTAeFw0yNTA5MjYwOTE4MzhaFw0zNTA5MjQwOTE4
16
+ MzhaMHcxCzAJBgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0
17
+ eTEVMBMGA1UECgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25h
18
+ bCBVbml0MRQwEgYDVQQDDAtDb21tb24gTmFtZTBZMBMGByqGSM49AgEGCCqGSM49
19
+ AwEHA0IABMc4Sy/fU/Qw5g1vJsvnVb63pmd5WKPZfg+rAZHGg/isWJHfnh4QqQwX
20
+ yCpwyCxu1zTqZdzwWuADguAZBpK6qtMwCgYIKoZIzj0EAwIDSAAwRQIhAMTUyNcu
21
+ iVbprDZNcnP58QoqQd3tIyod4eusUqIYjnIUAiAQsnjz0Ffer7IcrXG6pfscfi5O
22
+ JbGxeRO0TFgSybUMBg==
23
+ -----END CERTIFICATE-----
24
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPtt
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: PyPtt
5
5
  Home-page: https://pyptt.cc/
6
6
  Author: CodingMan
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Programming Language :: Python :: 3 :: Only
22
23
  Classifier: Natural Language :: Chinese (Traditional)
23
24
  Classifier: Natural Language :: English
@@ -64,7 +65,7 @@ PyPtt 是一套以 Pure Python 實作的 PTT (批踢踢) SDK,提供了完整
64
65
  - 其他功能: 即時訊息(水球)、P幣轉帳
65
66
 
66
67
  ### 系統需求
67
- - Python 3.6+
68
+ - Python 3.8 以上
68
69
  - 非雲端環境 (因 PTT 封鎖雲端 IP)
69
70
 
70
71
  ### 快速開始
@@ -20,7 +20,7 @@ PyPtt 是一套以 Pure Python 實作的 PTT (批踢踢) SDK,提供了完整
20
20
  - 其他功能: 即時訊息(水球)、P幣轉帳
21
21
 
22
22
  ### 系統需求
23
- - Python 3.6+
23
+ - Python 3.8 以上
24
24
  - 非雲端環境 (因 PTT 封鎖雲端 IP)
25
25
 
26
26
  ### 快速開始
@@ -107,6 +107,7 @@ setup(
107
107
  'Programming Language :: Python :: 3.10',
108
108
  'Programming Language :: Python :: 3.11',
109
109
  'Programming Language :: Python :: 3.12',
110
+ 'Programming Language :: Python :: 3.13',
110
111
  'Programming Language :: Python :: 3 :: Only',
111
112
 
112
113
  'Natural Language :: Chinese (Traditional)',
@@ -1,24 +0,0 @@
1
- key = """-----BEGIN EC PARAMETERS-----
2
- BggqhkjOPQMBBw==
3
- -----END EC PARAMETERS-----
4
- -----BEGIN EC PRIVATE KEY-----
5
- MHcCAQEEIAUeDeLJz7Ast36veGFEaSoUTiQKLFuHZ4JqgT2CHh7poAoGCCqGSM49
6
- AwEHoUQDQgAEOaAq4rxVKFcwKhvnBnkCcj57MMttX9dh79qMgYth50tkp3aNXSZc
7
- NPQHUur09OejfBy3/V9eoXBMj2f3HhoT/Q==
8
- -----END EC PRIVATE KEY-----
9
- """
10
-
11
- cert = """-----BEGIN CERTIFICATE-----
12
- MIIB6TCCAY8CFEq/uOD3yklb0FR3ITccL0U0XJjPMAoGCCqGSM49BAMCMHcxCzAJ
13
- BgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0eTEVMBMGA1UE
14
- CgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25hbCBVbml0MRQw
15
- EgYDVQQDDAtDb21tb24gTmFtZTAeFw0yNTA5MTMxMDM4MjVaFw0zNTA5MTExMDM4
16
- MjVaMHcxCzAJBgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0
17
- eTEVMBMGA1UECgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25h
18
- bCBVbml0MRQwEgYDVQQDDAtDb21tb24gTmFtZTBZMBMGByqGSM49AgEGCCqGSM49
19
- AwEHA0IABDmgKuK8VShXMCob5wZ5AnI+ezDLbV/XYe/ajIGLYedLZKd2jV0mXDT0
20
- B1Lq9PTno3wct/1fXqFwTI9n9x4aE/0wCgYIKoZIzj0EAwIDSAAwRQIhAIe+zYvB
21
- ylTH27vXomiPRtCMzw42FifKnHtEyKDA6wXyAiBLiB283NBQsJmNACVhz/yKllMB
22
- wjXzSUhrTUBPbsqYyA==
23
- -----END CERTIFICATE-----
24
- """
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes