PyPtt 2.3.13__tar.gz → 2.3.14__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.
- {pyptt-2.3.13 → pyptt-2.3.14}/PKG-INFO +1 -1
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/__init__.py +1 -1
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_time.py +3 -2
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt.egg-info/PKG-INFO +1 -1
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_new_screen_fixes.py +11 -1
- {pyptt-2.3.13 → pyptt-2.3.14}/LICENSE +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/PTT.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_bucket.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_call_status.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_change_pw.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_comment.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_del_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_board_info.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_board_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_bottom_post_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_favourite_board.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_newest_index.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_post_index.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_post_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_user.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_get_waterball.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_give_money.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_has_new_mail.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_loginout.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_mail.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_mark_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_reply_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_search_user.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_set_board_title.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_set_signature_file.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_api_util.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_uao/LICENSE +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_uao/__init__.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_uao/b2u.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/_uao/u2b.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/api_server.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/check_value.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/command.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/config.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/connect_core.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/data_type.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/exceptions.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/i18n.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/lang_en_US.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/lang_zh_TW.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/lib_util.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/log.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/screens.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/service.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt/ssl_config.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt.egg-info/SOURCES.txt +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt.egg-info/dependency_links.txt +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt.egg-info/requires.txt +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/PyPtt.egg-info/top_level.txt +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/README.md +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/pyproject.toml +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/setup.cfg +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/setup.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_backup_effective.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_backup_param.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_board_setting_flow.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_bucket.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_change_pw.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_comment.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_connect_core_timeout.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_del_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_del_post_unit.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_exceptions.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_fast_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_board_info.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_board_info_parser.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_board_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_bottom_post_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_content_formula.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_favourite_boards.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_mail.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_newest_index.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_post_list.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_post_list_parser.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_post_parser.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_time.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_user.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_get_waterball.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_give_money.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_half_dead_connection.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_i18n.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_incremental_parity.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_init.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_logger.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_login_logout.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_mail_send_and_del.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_main_menu_status_bar.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_mark_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_parse_query_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_post_anonymous.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_pyte_parity.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_reply_post.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_search_user.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_service.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_set_board_title.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_set_signature_file.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_status_line.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_uao_codec.py +0 -0
- {pyptt-2.3.13 → pyptt-2.3.14}/tests/test_vt100_parser.py +0 -0
|
@@ -8,7 +8,7 @@ from . import i18n
|
|
|
8
8
|
from . import log
|
|
9
9
|
from . import screens
|
|
10
10
|
|
|
11
|
-
pattern = re.compile(r'
|
|
11
|
+
pattern = re.compile(r'(\d{1,2}):(\d{2})')
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def get_time(api) -> str:
|
|
@@ -46,5 +46,6 @@ def _find_time(line_list):
|
|
|
46
46
|
if '線上' in line:
|
|
47
47
|
result = pattern.search(line)
|
|
48
48
|
if result is not None:
|
|
49
|
-
|
|
49
|
+
# 10 點前小時不補零 (週六 9:18), 統一回傳 HH:MM
|
|
50
|
+
return f'{int(result.group(1)):02d}:{result.group(2)}'
|
|
50
51
|
return None
|
|
@@ -17,7 +17,7 @@ from unittest.mock import MagicMock
|
|
|
17
17
|
import pytest
|
|
18
18
|
|
|
19
19
|
import PyPtt
|
|
20
|
-
from PyPtt import (_api_get_favourite_board, _api_get_newest_index, _api_get_post_list, _api_give_money,
|
|
20
|
+
from PyPtt import (_api_get_favourite_board, _api_get_newest_index, _api_get_time, _api_get_post_list, _api_give_money,
|
|
21
21
|
_api_util, command, config, connect_core, data_type, exceptions, i18n, screens)
|
|
22
22
|
|
|
23
23
|
i18n.init(PyPtt.Language.ENGLISH)
|
|
@@ -404,3 +404,13 @@ def test_favourites_target_matches(name):
|
|
|
404
404
|
core.get_screen_queue.return_value = [_fx('favourites_new_p5.txt')]
|
|
405
405
|
_api_get_favourite_board.get_favourite_board(_mock_api(core))
|
|
406
406
|
assert target_list[0].is_match(_fx(name), '>')
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
@pytest.mark.parametrize('bar, expected', [
|
|
410
|
+
# 10 點前狀態列的小時不補零, get_time 仍要回 HH:MM
|
|
411
|
+
(' 主選單 [ 獅子時 ] 10/24 週六 9:18 | DeepLearning | 線上23636人 (h)說明 ', '09:18'),
|
|
412
|
+
(' 主選單 [ 獅子時 ] 10/24 週六 0:05 | DeepLearning | 線上23636人 (h)說明 ', '00:05'),
|
|
413
|
+
('主選單 世界郵政日 10/9 週五 15:04 | janice001 | 線上24305人 (h)說明', '15:04'),
|
|
414
|
+
])
|
|
415
|
+
def test_get_time_zero_pads_hour(bar, expected):
|
|
416
|
+
assert _api_get_time._find_time(['', bar]) == expected
|
|
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
|
|
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
|
|
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
|