pymud 0.21.1__py3-none-any.whl → 0.21.2__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/settings.py CHANGED
@@ -1,196 +1,196 @@
1
- """
2
- PyMUD Settings 文件
3
- 用于保存与App有关的各类配置、常量等
4
- """
5
-
6
- import importlib.metadata
7
-
8
- class Settings:
9
- "保存PyMUD配置的全局对象"
10
-
11
- # 下列内容为APP的常量定义,请勿修改
12
- __appname__ = "PYMUD"
13
- "APP 名称, 默认PYMUD"
14
- __appdesc__ = "a MUD client written in Python"
15
- "APP 简要描述"
16
- __version__ = importlib.metadata.version("pymud")
17
- "APP 当前版本"
18
- __release__ = "2025-05-27"
19
- "APP 当前版本发布日期"
20
- __author__ = "本牛(newstart)@北侠"
21
- "APP 作者"
22
- __email__ = "crapex@crapex.cc"
23
- "APP 作者邮箱"
24
- __website__ = "https://pymud.readthedocs.io/"
25
- "帮助文档发布网址"
26
-
27
- language = "chs"
28
-
29
- server = {
30
- "default_encoding" : "utf-8", # 服务器默认编码
31
- "encoding_errors" : "ignore", # 默认编码转换失效时错误处理
32
- "newline" : "\n", # 服务器端换行符特性
33
-
34
-
35
- "SGA" : True, # Supress Go Ahead
36
- "ECHO" : False, # Echo
37
- "GMCP" : True, # Generic Mud Communication Protocol
38
- "MSDP" : True, # Mud Server Data Protocol
39
- "MSSP" : True, # Mud Server Status Protocol
40
- "MCCP2" : False, # Mud Compress Communication Protocol V2
41
- "MCCP3" : False, # Mud Compress Communication Protocol V3
42
- "MSP" : False, # Mud 音频协议
43
- "MXP" : False, # Mud 扩展协议
44
- }
45
- "服务器的默认配置信息"
46
-
47
- mnes = {
48
- "CHARSET" : server["default_encoding"],
49
- "CLIENT_NAME" : __appname__,
50
- "CLIENT_VERSION" : __version__,
51
- "AUTHOR" : __author__,
52
- }
53
- "MUD协议所需的的默认MNES(Mud New-Environment Standard)配置信息"
54
-
55
- client = {
56
- "buffer_lines" : 5000, # 保留缓冲行数
57
-
58
- "naws_width" : 150, # 客户端NAWS宽度
59
- "naws_height" : 40, # 客户端NAWS高度
60
- "newline" : "\n", # 客户端换行符
61
- "tabstop" : 4, # 制表符改成空格
62
- "seperator" : ";", # 多个命令分隔符(默认;)
63
- "appcmdflag" : "#", # app命令标记(默认#)
64
-
65
- "interval" : 10, # 在自动执行中,两次命令输入中的间隔时间(ms)
66
- "auto_connect" : True, # 创建会话后,是否自动连接
67
- "auto_reconnect" : False, # 在会话异常断开之后,是否自动重连
68
- "reconnect_wait" : 15, # 自动重连等待的时间(秒数)
69
- "var_autosave" : True, # 断开时自动保存会话变量
70
- "var_autoload" : True, # 初始化时自动加载会话变量
71
-
72
- "remain_last_input" : False,
73
- "echo_input" : False,
74
- "beautify" : True, # 专门为解决控制台下PKUXKX字符画对不齐的问题
75
- "history_records" : 500, # 记录发送到服务器的命令的上限数量,0表示不记录,-1表示无限记录
76
-
77
- "status_divider" : True, # 是否显示状态栏的分隔线
78
- "status_display" : 1, # 状态窗口显示情况设置,0-不显示,1-显示在下方,2-显示在右侧
79
- "status_width" : 30, # 右侧状态栏的宽度
80
- "status_height" : 6, # 下侧状态栏的高度
81
- }
82
- "客户端的默认配置信息"
83
-
84
- text = {
85
- "welcome" : "欢迎使用PYMUD客户端 - 北大侠客行,最好的中文MUD游戏",
86
- "world" : "世界",
87
- "new_session" : "创建新会话...",
88
- "show_log" : "显示记录信息",
89
- "exit" : "退出",
90
- "session" : "会话",
91
- "connect" : "连接/重新连接",
92
- "disconnect" : "断开连接",
93
- "beautify" : "打开/关闭美化显示",
94
- "echoinput" : "显示/隐藏输入指令",
95
- "nosplit" : "取消分屏",
96
- "copy" : "复制(纯文本)",
97
- "copyraw" : "复制(ANSI)",
98
- "clearsession" : "清空会话内容",
99
- "closesession" : "关闭当前页面",
100
- "autoreconnect" : "打开/关闭自动重连",
101
- "loadconfig" : "加载脚本配置",
102
- "reloadconfig" : "重新加载脚本配置",
103
- "layout" : "布局",
104
- "hide" : "隐藏状态窗口",
105
- "horizon" : "下方状态窗口",
106
- "vertical" : "右侧状态窗口",
107
- "help" : "帮助",
108
- "about" : "关于",
109
-
110
- "session_changed" : "已成功切换到会话: {0}",
111
-
112
- "input_prompt" : '<prompt><b>命令:</b></prompt>', # HTML格式,输入命令行的提示信息
113
- }
114
-
115
-
116
- keys = {
117
- "f3" : "#ig",
118
- "f4" : "#clear",
119
- "f5" : "",
120
- "f6" : "",
121
- "f7" : "",
122
- "f8" : "",
123
- "f9" : "",
124
- "f10" : "",
125
- "f11" : "#close",
126
- "f12" : "#exit",
127
-
128
- "c-1" : "",
129
- "c-2" : "",
130
- "c-3" : "",
131
- "c-4" : "",
132
- "c-5" : "",
133
- "c-6" : "",
134
- "c-7" : "",
135
- "c-8" : "",
136
- "c-9" : "",
137
- "c-0" : "",
138
- }
139
-
140
- sessions = {
141
- "pkuxkx" : {
142
- "host" : "mud.pkuxkx.net",
143
- "port" : "8081",
144
- "encoding" : "utf8",
145
- "autologin" : "{0};{1}",
146
- "default_script": "common_modules",
147
- "chars" : {
148
- "display_title" : ["yourid", "yourpassword", "special_modules"],
149
- }
150
- },
151
- "another-mud-evennia" : {
152
- "host" : "another.mud",
153
- "port" : "4000",
154
- "encoding" : "utf8",
155
- "autologin" : "connect {0} {1}",
156
- "default_script": None,
157
- "chars" : {
158
- "evennia" : ["name", "pass"],
159
- }
160
- }
161
- }
162
-
163
- styles = {
164
- "status" : "reverse",
165
- "shadow" : "bg:#440044",
166
-
167
- "prompt" : "",
168
-
169
- "selected" : "bg:#555555 fg:#eeeeee bold",
170
- "selected.connected" : "bg:#555555 fg:#33ff33 bold",
171
- "normal" : "fg:#aaaaaa",
172
- "normal.connected" : "fg:#33aa33",
173
-
174
- "skyblue" : "fg:skyblue",
175
- "yellow" : "fg:yellow",
176
- "red" : "fg:red",
177
- "green" : "fg:green",
178
- "blue" : "fg:blue",
179
- "link" : "fg:green underline",
180
- "title" : "bold",
181
- "value" : "fg:green",
182
- }
183
-
184
- INFO_STYLE = "\x1b[48;5;22m\x1b[38;5;252m" #"\x1b[38;2;0;128;255m"
185
- WARN_STYLE = "\x1b[48;5;220m\x1b[38;5;238m"
186
- ERR_STYLE = "\x1b[48;5;160m\x1b[38;5;252m"
187
- CLR_STYLE = "\x1b[0m"
188
-
189
- @classmethod
190
- def gettext(cls, text: str, *args, **kwargs):
191
- if len(args) == 0 and len(kwargs) == 0:
192
- return cls.text[text] if text in cls.text else text
193
- else:
194
- return cls.text[text].format(*args, **kwargs) if text in cls.text else text.format(*args, **kwargs)
195
-
196
-
1
+ """
2
+ PyMUD Settings 文件
3
+ 用于保存与App有关的各类配置、常量等
4
+ """
5
+
6
+ import importlib.metadata
7
+
8
+ class Settings:
9
+ "保存PyMUD配置的全局对象"
10
+
11
+ # 下列内容为APP的常量定义,请勿修改
12
+ __appname__ = "PYMUD"
13
+ "APP 名称, 默认PYMUD"
14
+ __appdesc__ = "a MUD client written in Python"
15
+ "APP 简要描述"
16
+ __version__ = importlib.metadata.version("pymud")
17
+ "APP 当前版本"
18
+ __release__ = "2025-05-27"
19
+ "APP 当前版本发布日期"
20
+ __author__ = "本牛(newstart)@北侠"
21
+ "APP 作者"
22
+ __email__ = "crapex@crapex.cc"
23
+ "APP 作者邮箱"
24
+ __website__ = "https://pymud.readthedocs.io/"
25
+ "帮助文档发布网址"
26
+
27
+ language = "chs"
28
+
29
+ server = {
30
+ "default_encoding" : "utf-8", # 服务器默认编码
31
+ "encoding_errors" : "ignore", # 默认编码转换失效时错误处理
32
+ "newline" : "\n", # 服务器端换行符特性
33
+
34
+
35
+ "SGA" : True, # Supress Go Ahead
36
+ "ECHO" : False, # Echo
37
+ "GMCP" : True, # Generic Mud Communication Protocol
38
+ "MSDP" : True, # Mud Server Data Protocol
39
+ "MSSP" : True, # Mud Server Status Protocol
40
+ "MCCP2" : False, # Mud Compress Communication Protocol V2
41
+ "MCCP3" : False, # Mud Compress Communication Protocol V3
42
+ "MSP" : False, # Mud 音频协议
43
+ "MXP" : False, # Mud 扩展协议
44
+ }
45
+ "服务器的默认配置信息"
46
+
47
+ mnes = {
48
+ "CHARSET" : server["default_encoding"],
49
+ "CLIENT_NAME" : __appname__,
50
+ "CLIENT_VERSION" : __version__,
51
+ "AUTHOR" : __author__,
52
+ }
53
+ "MUD协议所需的的默认MNES(Mud New-Environment Standard)配置信息"
54
+
55
+ client = {
56
+ "buffer_lines" : 5000, # 保留缓冲行数
57
+
58
+ "naws_width" : 150, # 客户端NAWS宽度
59
+ "naws_height" : 40, # 客户端NAWS高度
60
+ "newline" : "\n", # 客户端换行符
61
+ "tabstop" : 4, # 制表符改成空格
62
+ "seperator" : ";", # 多个命令分隔符(默认;)
63
+ "appcmdflag" : "#", # app命令标记(默认#)
64
+
65
+ "interval" : 10, # 在自动执行中,两次命令输入中的间隔时间(ms)
66
+ "auto_connect" : True, # 创建会话后,是否自动连接
67
+ "auto_reconnect" : False, # 在会话异常断开之后,是否自动重连
68
+ "reconnect_wait" : 15, # 自动重连等待的时间(秒数)
69
+ "var_autosave" : True, # 断开时自动保存会话变量
70
+ "var_autoload" : True, # 初始化时自动加载会话变量
71
+
72
+ "remain_last_input" : False,
73
+ "echo_input" : False,
74
+ "beautify" : True, # 专门为解决控制台下PKUXKX字符画对不齐的问题
75
+ "history_records" : 500, # 记录发送到服务器的命令的上限数量,0表示不记录,-1表示无限记录
76
+
77
+ "status_divider" : True, # 是否显示状态栏的分隔线
78
+ "status_display" : 1, # 状态窗口显示情况设置,0-不显示,1-显示在下方,2-显示在右侧
79
+ "status_width" : 30, # 右侧状态栏的宽度
80
+ "status_height" : 6, # 下侧状态栏的高度
81
+ }
82
+ "客户端的默认配置信息"
83
+
84
+ text = {
85
+ "welcome" : "欢迎使用PYMUD客户端 - 北大侠客行,最好的中文MUD游戏",
86
+ "world" : "世界",
87
+ "new_session" : "创建新会话...",
88
+ "show_log" : "显示记录信息",
89
+ "exit" : "退出",
90
+ "session" : "会话",
91
+ "connect" : "连接/重新连接",
92
+ "disconnect" : "断开连接",
93
+ "beautify" : "打开/关闭美化显示",
94
+ "echoinput" : "显示/隐藏输入指令",
95
+ "nosplit" : "取消分屏",
96
+ "copy" : "复制(纯文本)",
97
+ "copyraw" : "复制(ANSI)",
98
+ "clearsession" : "清空会话内容",
99
+ "closesession" : "关闭当前页面",
100
+ "autoreconnect" : "打开/关闭自动重连",
101
+ "loadconfig" : "加载脚本配置",
102
+ "reloadconfig" : "重新加载脚本配置",
103
+ "layout" : "布局",
104
+ "hide" : "隐藏状态窗口",
105
+ "horizon" : "下方状态窗口",
106
+ "vertical" : "右侧状态窗口",
107
+ "help" : "帮助",
108
+ "about" : "关于",
109
+
110
+ "session_changed" : "已成功切换到会话: {0}",
111
+
112
+ "input_prompt" : '<prompt><b>命令:</b></prompt>', # HTML格式,输入命令行的提示信息
113
+ }
114
+
115
+
116
+ keys = {
117
+ "f3" : "#ig",
118
+ "f4" : "#clear",
119
+ "f5" : "",
120
+ "f6" : "",
121
+ "f7" : "",
122
+ "f8" : "",
123
+ "f9" : "",
124
+ "f10" : "",
125
+ "f11" : "#close",
126
+ "f12" : "#exit",
127
+
128
+ "c-1" : "",
129
+ "c-2" : "",
130
+ "c-3" : "",
131
+ "c-4" : "",
132
+ "c-5" : "",
133
+ "c-6" : "",
134
+ "c-7" : "",
135
+ "c-8" : "",
136
+ "c-9" : "",
137
+ "c-0" : "",
138
+ }
139
+
140
+ sessions = {
141
+ "pkuxkx" : {
142
+ "host" : "mud.pkuxkx.net",
143
+ "port" : "8081",
144
+ "encoding" : "utf8",
145
+ "autologin" : "{0};{1}",
146
+ "default_script": "common_modules",
147
+ "chars" : {
148
+ "display_title" : ["yourid", "yourpassword", "special_modules"],
149
+ }
150
+ },
151
+ "another-mud-evennia" : {
152
+ "host" : "another.mud",
153
+ "port" : "4000",
154
+ "encoding" : "utf8",
155
+ "autologin" : "connect {0} {1}",
156
+ "default_script": None,
157
+ "chars" : {
158
+ "evennia" : ["name", "pass"],
159
+ }
160
+ }
161
+ }
162
+
163
+ styles = {
164
+ "status" : "reverse",
165
+ "shadow" : "bg:#440044",
166
+
167
+ "prompt" : "",
168
+
169
+ "selected" : "bg:#555555 fg:#eeeeee bold",
170
+ "selected.connected" : "bg:#555555 fg:#33ff33 bold",
171
+ "normal" : "fg:#aaaaaa",
172
+ "normal.connected" : "fg:#33aa33",
173
+
174
+ "skyblue" : "fg:skyblue",
175
+ "yellow" : "fg:yellow",
176
+ "red" : "fg:red",
177
+ "green" : "fg:green",
178
+ "blue" : "fg:blue",
179
+ "link" : "fg:green underline",
180
+ "title" : "bold",
181
+ "value" : "fg:green",
182
+ }
183
+
184
+ INFO_STYLE = "\x1b[48;5;22m\x1b[38;5;252m" #"\x1b[38;2;0;128;255m"
185
+ WARN_STYLE = "\x1b[48;5;220m\x1b[38;5;238m"
186
+ ERR_STYLE = "\x1b[48;5;160m\x1b[38;5;252m"
187
+ CLR_STYLE = "\x1b[0m"
188
+
189
+ @classmethod
190
+ def gettext(cls, text: str, *args, **kwargs):
191
+ if len(args) == 0 and len(kwargs) == 0:
192
+ return cls.text[text] if text in cls.text else text
193
+ else:
194
+ return cls.text[text].format(*args, **kwargs) if text in cls.text else text.format(*args, **kwargs)
195
+
196
+