Skip to content

Commit 9ebd6cd

Browse files
committed
update runtime text prompts
1 parent 349c18c commit 9ebd6cd

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed
46 Bytes
Binary file not shown.

fastapi_ccli/CN/cloner_zh.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ def __exec_clone(orm: str, src: str, path: str, path_style: str) -> None:
183183
try:
184184
# typer.launch(src)
185185
if 'sqlalchemy' in orm:
186-
print(f'开始克隆存储库 {src.split()[1]}{src.split()[0]} 分支 🚀')
186+
print(f'开始克隆存储库 {src.split()[1]}{src.split()[0]} 分支')
187187
out = os.system(f'git clone -b {src} {path}')
188188
else:
189-
print(f'开始克隆存储库 {src} 🚀')
189+
print(f'开始克隆存储库 {src}')
190190
out = os.system(f'git clone {src} {path}')
191191
if out != 0:
192192
raise RuntimeError(out)
193193
except Exception as e:
194-
print(f'克隆项目失败 ❌: {e}')
194+
print(f'❌ 克隆项目失败: {e}')
195195
raise typer.Exit(code=1)
196196
else:
197-
print('项目克隆成功 ✅')
197+
print('✅ 项目克隆成功')
198198
typer.echo(f'请到目录 {path_style} 查看')
199199
raise typer.Abort()

fastapi_ccli/CN/cloner_zh_form.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,17 @@ def __exec_clone(orm: str, src: str, path: str, path_style: str) -> None:
197197
try:
198198
# typer.launch(src)
199199
if 'SQLAlchemy' in orm:
200-
print(f'开始克隆存储库 {src.split()[1]}{src.split()[0]} 分支 🚀')
200+
print(f'开始克隆存储库 {src.split()[1]}{src.split()[0]} 分支')
201201
out = os.system(f'git clone -b {src} {path}')
202202
else:
203-
print(f'开始克隆存储库 {src} 🚀')
203+
print(f'开始克隆存储库 {src}')
204204
out = os.system(f'git clone {src} {path}')
205205
if out != 0:
206206
raise RuntimeError(out)
207207
except Exception as e:
208-
print(f'克隆项目失败 ❌: {e}')
208+
print(f'❌ 克隆项目失败: {e}')
209209
raise typer.Exit(code=1)
210210
else:
211-
print('项目克隆成功 ✅')
211+
print('✅ 项目克隆成功')
212212
typer.echo(f'请到目录 {path_style} 查看')
213213
raise typer.Abort()

fastapi_ccli/EN/cloner_en.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,17 @@ def __exec_clone(orm: str, src: str, path: str, path_style: str) -> None:
184184
try:
185185
# typer.launch(src)
186186
if 'sqlalchemy' in orm:
187-
print(f'Start cloning branch {src.split()[0]} of repository {src.split()[1]} 🚀')
187+
print(f'Start cloning branch {src.split()[0]} of repository {src.split()[1]}')
188188
out = os.system(f'git clone -b {src} {path}')
189189
else:
190-
print(f'Start cloning repository {src} 🚀')
190+
print(f'Start cloning repository {src}')
191191
out = os.system(f'git clone {src} {path}')
192192
if out != 0:
193193
raise RuntimeError(out)
194194
except Exception as e:
195-
print(f'Clone project failed: {e}')
195+
print(f'Clone project failed: {e}')
196196
raise typer.Exit(code=1)
197197
else:
198-
print('The project was cloned successfully')
198+
print('The project was cloned successfully')
199199
typer.echo(f'Please go to the directory {path_style} to view')
200200
raise typer.Abort()

fastapi_ccli/EN/cloner_en_form.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,17 @@ def __exec_clone(orm: str, src: str, path: str, path_style: str) -> None:
198198
try:
199199
# typer.launch(src)
200200
if 'SQLAlchemy' in orm:
201-
print(f'Start cloning the {src.split()[0]} branch of the repository {src.split()[1]} 🚀')
201+
print(f'Start cloning the {src.split()[0]} branch of the repository {src.split()[1]}')
202202
out = os.system(f'git clone -b {src} {path}')
203203
else:
204-
print(f'Start cloning the repository {src} 🚀')
204+
print(f'Start cloning the repository {src}')
205205
out = os.system(f'git clone {src} {path}')
206206
if out != 0:
207207
raise RuntimeError(out)
208208
except Exception as e:
209-
print(f'Clone repository failed: {e}')
209+
print(f'Clone repository failed: {e}')
210210
raise typer.Exit(code=1)
211211
else:
212-
print('The repository was cloned successfully')
212+
print('The repository was cloned successfully')
213213
typer.echo(f'Please go to the directory {path_style} to view')
214214
raise typer.Abort()

fastapi_ccli/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
from pathlib import Path
55

6+
import questionary
67
import typer
78

89
sys.path.append(str(Path(__file__).resolve().parent.parent))
@@ -14,8 +15,10 @@
1415

1516

1617
def main():
17-
language = typer.confirm('是否使用中文提示 | Whether to use Chinese prompts?', default=True)
18-
if language:
18+
select_language = questionary.form(
19+
language = questionary.select('Please select your language:', choices=['zh-hans', 'en'], default='en')
20+
).unsafe_ask()
21+
if select_language['language']:
1922
interactive_zh = typer.confirm('是否以交互模式运行?', default=True)
2023
if interactive_zh:
2124
app_zh_form()

0 commit comments

Comments
 (0)