pymud 0.20.2a4__py3-none-any.whl → 0.20.2a5__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
@@ -66,8 +66,8 @@ class MudFormatProcessor(Processor):
66
66
  self.FULL_BLOCKS = set("▂▃▅▆▇▄█")
67
67
  self.SINGLE_LINES = set("┌└├┬┼┴╭╰─")
68
68
  self.DOUBLE_LINES = set("╔╚╠╦╪╩═")
69
- #self.START_COLOR_REGX = re.compile(r"^\[[\d;]+m")
70
- self.COLOR_REGX = re.compile(r"(?:\[[\d;]+m)+(?!$)")
69
+ self.ALL_COLOR_REGX = re.compile(r"(?:\[[\d;]+m)+")
70
+ self.AVAI_COLOR_REGX = re.compile(r"(?:\[[\d;]+m)+(?!$)")
71
71
  self._color_start = ""
72
72
  self._color_correction = False
73
73
  self._color_line_index = 0
@@ -111,21 +111,25 @@ class MudFormatProcessor(Processor):
111
111
  line = fragment_list_to_text(transformation_input.fragments)
112
112
 
113
113
  # 颜色校正
114
- thislinecolors = len(self.COLOR_REGX.findall(line))
114
+ thislinecolors = len(self.AVAI_COLOR_REGX.findall(line))
115
115
  if thislinecolors == 0:
116
116
  lineno = transformation_input.lineno - 1
117
117
  while lineno > 0:
118
118
  lastline = transformation_input.document.lines[lineno]
119
- # color = self.START_COLOR_REGX.findall(lastline)
120
- # if color:
121
- colors = self.COLOR_REGX.findall(lastline)
119
+ allcolors = self.ALL_COLOR_REGX.findall(lastline)
122
120
 
123
- if len(colors) == 0:
124
- lineno = lineno -1
121
+ if len(allcolors) == 0:
122
+ lineno = lineno - 1
125
123
 
126
- elif len(colors) == 1:
127
- line = f"{colors[0]}{line}"
128
- break
124
+ elif len(allcolors) == 1:
125
+ colors = self.AVAI_COLOR_REGX.findall(lastline)
126
+
127
+ if len(colors) == 1:
128
+ line = f"{colors[0]}{line}"
129
+ break
130
+
131
+ else:
132
+ break
129
133
 
130
134
  else:
131
135
  break
pymud/session.py CHANGED
@@ -3217,7 +3217,7 @@ class Session:
3217
3217
  # msg = Settings.client["newline"].join(new_lines)
3218
3218
 
3219
3219
  # 将颜色跨行显示移动到了MudFormatProcessor中,此处无需再处理(不行,还得恢复)
3220
- self.writetobuffer("{}〔{}〕{}".format(style, title, msg, Settings.CLR_STYLE), newline = True)
3220
+ self.writetobuffer("{}〔{}〕{}{}".format(style, title, msg, Settings.CLR_STYLE), newline = True)
3221
3221
 
3222
3222
  def info(self, msg, title = "提示", style = Settings.INFO_STYLE):
3223
3223
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymud
3
- Version: 0.20.2a4
3
+ Version: 0.20.2a5
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>
@@ -1,7 +1,7 @@
1
1
  pymud/__init__.py,sha256=AP4Edhx90gMKrNfD1O_KVciA3SOnyX5Qt9fZY_JhsTY,574
2
2
  pymud/__main__.py,sha256=hFzZjadLlcOuoLM7D8wFiFVO8mqF7vMuo9y-9xfIhRc,64
3
3
  pymud/dialogs.py,sha256=p-LidObSuDyOeMif5CsqhF5qq3rizZ1lmThWHrxDyRg,6726
4
- pymud/extras.py,sha256=97KIOD6OxMDIMkAxAinbuKTMEtvPvO_F2DMbITQbekU,40827
4
+ pymud/extras.py,sha256=lCRlNIaYqrcCLGe8zrulFvh7aC5nU_jHFMD2sI9JCrU,40955
5
5
  pymud/logger.py,sha256=sq9HhZ6-prY34NnDUO1NjaCRy-e5-fr2j0na8FKp9ks,5789
6
6
  pymud/main.py,sha256=b_Ui_cN4W8IfhYNyc1duwr3Bp7pYYZQusKTSafCWZIA,6534
7
7
  pymud/modules.py,sha256=XoqTeYfZCgqDsV3SYxeehzsbkTzs0swelAUIxyWuL9g,7423
@@ -9,11 +9,11 @@ pymud/objects.py,sha256=qSOFuVZvMh3lxjg6x5JUzcr_sTSgakWWySh801x7TNQ,39457
9
9
  pymud/pkuxkx.py,sha256=jRQRUs2xtw7GzYHtLYZXOASnqMumKh0iCoOeKZs8NnU,11467
10
10
  pymud/protocol.py,sha256=nlsyXMBAHEf_067mPNGDHzN_zIm9808D8YDIZTNrygg,49118
11
11
  pymud/pymud.py,sha256=4v-pdSheWfWCK7O-3bAipK7WE6zPe8mRLil7E1Zbnas,51663
12
- pymud/session.py,sha256=qOQJbh-EW1uQwS36UpZncLHgVJDJ4bawfqqPASeylmM,138999
12
+ pymud/session.py,sha256=dO6asU6Pva9JjuhecyUHDCp1qH59FkSIUsmJbTjtFDI,139001
13
13
  pymud/settings.py,sha256=LHDomT7AMVUi1QQqlFS02mgQ6AqJJBkZeg8YoF-43SE,7204
14
- pymud-0.20.2a4.dist-info/LICENSE.txt,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
15
- pymud-0.20.2a4.dist-info/METADATA,sha256=Ru0i-uTvROJHer1YOaNPV8oZC99LiYU67m62YyZLLbA,75041
16
- pymud-0.20.2a4.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
17
- pymud-0.20.2a4.dist-info/entry_points.txt,sha256=diPUOtTkhgC1hVny7Cdg4aRhaHSynMQoraE7ZhJxUcw,37
18
- pymud-0.20.2a4.dist-info/top_level.txt,sha256=8Gp1eXjxixXjqhhti6tLCspV_8s9sNV3z5Em2_KRhD4,6
19
- pymud-0.20.2a4.dist-info/RECORD,,
14
+ pymud-0.20.2a5.dist-info/LICENSE.txt,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
15
+ pymud-0.20.2a5.dist-info/METADATA,sha256=8oYUsKU0Rwbys95Xc9esV2-5SfyV6VY7QVSTdP2fSZo,75041
16
+ pymud-0.20.2a5.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
17
+ pymud-0.20.2a5.dist-info/entry_points.txt,sha256=diPUOtTkhgC1hVny7Cdg4aRhaHSynMQoraE7ZhJxUcw,37
18
+ pymud-0.20.2a5.dist-info/top_level.txt,sha256=8Gp1eXjxixXjqhhti6tLCspV_8s9sNV3z5Em2_KRhD4,6
19
+ pymud-0.20.2a5.dist-info/RECORD,,