-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14c812b
commit 2aeb924
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
# 字符替换工具 | ||
|
||
from misc.Info import ProgramInfo | ||
|
||
class PS1: | ||
def paraphraser(prompt="[IShell] %u> "): | ||
# 返回值:替换后的字符串 | ||
# 将prompt中的特殊字符替换成对应的内容 | ||
# 特殊字符: | ||
# %n 程序名:默认为IShell | ||
# %v 版本号:默认为ProgramInfo.version | ||
# %u 用户:默认为Lanbin | ||
|
||
# 替换 | ||
prompt = prompt.replace("%n", "IShell") | ||
prompt = prompt.replace("%v", ProgramInfo.version) | ||
prompt = prompt.replace("%u", "Lanbin") | ||
return prompt | ||
|