pymud 0.21.2.post1__py3-none-any.whl → 0.21.3__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.
pymud/extras.py CHANGED
@@ -720,7 +720,7 @@ class PyMudBufferControl(UIControl):
720
720
  # Default reset. (Doesn't have to be implemented.)
721
721
  pass
722
722
 
723
- def preferred_width(self, max_available_width: int) -> int | None:
723
+ def preferred_width(self, max_available_width: int) -> Optional[int]:
724
724
  return None
725
725
 
726
726
  def is_focusable(self) -> bool:
pymud/objects.py CHANGED
@@ -793,12 +793,14 @@ class Command(MatchObject):
793
793
  """
794
794
  复位命令,并取消和清除所有本对象管理的任务。
795
795
  """
796
+ try:
797
+ super().reset()
796
798
 
797
- super().reset()
798
-
799
- for task in list(self._tasks):
800
- if isinstance(task, asyncio.Task) and (not task.done()):
801
- self.remove_task(task)
799
+ for task in list(self._tasks):
800
+ if isinstance(task, asyncio.Task) and (not task.done()):
801
+ self.remove_task(task)
802
+ except:
803
+ pass
802
804
 
803
805
  async def execute(self, cmd, *args, **kwargs) -> Any:
804
806
  """
pymud/session.py CHANGED
@@ -736,8 +736,14 @@ class Session:
736
736
  :param task: 由本会话管理的一个 asyncio.Task 对象
737
737
  :param msg: 本意是用来反馈 task.cancel() 时的消息,但为了保持兼容低版本Python环境,该参数并未使用。
738
738
  """
739
- result = task.cancel()
740
- self._tasks.discard(task)
739
+
740
+ result = True
741
+ try:
742
+ result = task.cancel()
743
+ self._tasks.discard(task)
744
+
745
+ except asyncio.CancelledError:
746
+ pass
741
747
 
742
748
  return result
743
749
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymud
3
- Version: 0.21.2.post1
3
+ Version: 0.21.3
4
4
  Summary: a MUD Client written in Python
5
5
  Author-email: "newstart@pkuxkx" <crapex@hotmail.com>
6
6
  Maintainer-email: "newstart@pkuxkx" <crapex@hotmail.com>
@@ -66,12 +66,17 @@ Dynamic: license-file
66
66
 
67
67
  ## 版本更新信息
68
68
 
69
+ ### 0.21.3 (2025-06-02)
70
+
71
+ + 问题修复: 修复了当缓存行数超过规定值时,由于代码错误导致清屏的问题。
72
+ + 功能增强: 增加清除任务时的异常保护,此时产生asyncio.CancelledError异常为正常现象,因此捕获后禁止异常处理。
73
+ + 功能增强: 对reset进行了异常提示保护,此时产生异常(大部分为asyncio.CancelledError)为正常现象,因此捕获后禁止异常处理。
74
+
69
75
  ### 0.21.2 (2025-06-01)
70
76
 
71
77
  + 问题修复: 修复了当自动重连启动时,即使会话关闭了,也会自动重连的问题。
72
78
  + 实现调整: 重写了专用的会话缓冲、记录缓冲与PyMud缓冲显示控制器,在prompt_toolkit的原Buffer和BufferControl的基础仅提供了PYMUD所需的基础功能,以降低内存占用。
73
79
  经测试,当前内存基本稳定,视会话数量和脚本情况差异,维持在几百兆左右(500M以下),且不会有大幅波动。重写后,低配置的VPS也可以稳定运行PyMUD。
74
- + post1: 问题修复: 修复了当缓存行数超过规定值时,由于代码错误导致清屏的问题。
75
80
 
76
81
  ### 0.21.0 (2025-05-20)
77
82
 
@@ -2,22 +2,22 @@ pymud/__init__.py,sha256=oeHz0NM7_DwChCY8f_vQ_fBq0e_HoTd0cahCFwaavWE,806
2
2
  pymud/__main__.py,sha256=lIOBiJmi8X-EWXVIx_OoxSgUZ0FYKlZI8hXVnLUYTJQ,61
3
3
  pymud/decorators.py,sha256=XaxcZqHw4s44lC2EAgB5kZmbNvJnHGmpZnoW75tUeNY,9844
4
4
  pymud/dialogs.py,sha256=4kHycr47UgKQUHGX-KMZvERuWViPjT4hNrGhbe4j-NU,7056
5
- pymud/extras.py,sha256=FQKZWn7ZR9J4H-FjXzbF5sxOTUNZ3b7tWxWhHhywplg,36657
5
+ pymud/extras.py,sha256=sW42ZVciaxUlWxKxrPYK2avL42lEA2gGeFyq2uEoOas,36660
6
6
  pymud/i18n.py,sha256=qLgvrmYhVfkTHKpbBR-LfYMOrGgi0skHrelbsj7ItbE,3034
7
7
  pymud/logger.py,sha256=WCsfXVkgl63qdq1RQEDJBnM7U0S6u8TeORFSMhcoydI,5840
8
8
  pymud/main.py,sha256=zaSjNhpbX3FMulKg-UNFrdiIJO8sOmmrUQrkPOalB-4,10224
9
9
  pymud/modules.py,sha256=DoCregng5iAj_Hq_yUvRPreRTv2Ehb6sV6_4jfdbsik,11912
10
- pymud/objects.py,sha256=ZOxNjlPD_d4jk5DMBcXgYcvkt9d8xZih0IQtQlA3f1Y,38668
10
+ pymud/objects.py,sha256=Z77KHbg06jIx9cIEiyHkWI5i3but4PFeZS_m2WHsFrs,38729
11
11
  pymud/pkuxkx.py,sha256=qDVry-Vd6MNui0NKWZFT52IpmP1sKS5Dz74EDY4tVGQ,14740
12
12
  pymud/protocol.py,sha256=KNKJYj9HFRoUy-jigNfhiQdDOM_kRSJE17QFpBarQTg,48335
13
13
  pymud/pymud.py,sha256=40hn5XyMH9mtjimx_zG7N2M6fAGciee1izO08jsfFzQ,53486
14
- pymud/session.py,sha256=8sl8hdmq2jwNxj3bAAp5zTv8eNGBW-GOxNpGCuHKbAg,154603
14
+ pymud/session.py,sha256=vzOIyc1F8PVP1XadcGt-n7XOoiawJzYsIEBe0FU5oKY,154716
15
15
  pymud/settings.py,sha256=S2sBEM7YtaDOVu3UpGfHBaU7zSB3Zhs7w-Z7PtdS0WQ,7697
16
16
  pymud/lang/i18n_chs.py,sha256=2cyaHHLwpYEBBwuQXyRTxa1opX53fTv1f8_QDQeGlC0,16836
17
17
  pymud/lang/i18n_eng.py,sha256=jcPz6Y5UuxJBQLY_e8UnEF3GYTlnAD44C14Oj7sK-QI,45935
18
- pymud-0.21.2.post1.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
- pymud-0.21.2.post1.dist-info/METADATA,sha256=dBJD-AP44lsOfy-glrThVBKIcAA_mTbWvJUkNX2PEmE,45258
20
- pymud-0.21.2.post1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- pymud-0.21.2.post1.dist-info/entry_points.txt,sha256=diPUOtTkhgC1hVny7Cdg4aRhaHSynMQoraE7ZhJxUcw,37
22
- pymud-0.21.2.post1.dist-info/top_level.txt,sha256=8Gp1eXjxixXjqhhti6tLCspV_8s9sNV3z5Em2_KRhD4,6
23
- pymud-0.21.2.post1.dist-info/RECORD,,
18
+ pymud-0.21.3.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
+ pymud-0.21.3.dist-info/METADATA,sha256=qPEupei-bfThOmCWrh1NJdEEkwBuzdlSGzfGv4OnXaU,45592
20
+ pymud-0.21.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ pymud-0.21.3.dist-info/entry_points.txt,sha256=diPUOtTkhgC1hVny7Cdg4aRhaHSynMQoraE7ZhJxUcw,37
22
+ pymud-0.21.3.dist-info/top_level.txt,sha256=8Gp1eXjxixXjqhhti6tLCspV_8s9sNV3z5Em2_KRhD4,6
23
+ pymud-0.21.3.dist-info/RECORD,,