Skip to content

Commit

Permalink
feat: provide a hint when no name is specified for janim tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jkjkil4 committed Jul 1, 2024
1 parent 6d02b04 commit 99c3e35
Show file tree
Hide file tree
Showing 28 changed files with 61 additions and 49 deletions.
4 changes: 4 additions & 0 deletions janim/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def write(args: Namespace) -> None:


def tool(args: Namespace) -> None:
if not args.tool_name:
log.error(_('No tool specified for use'))
return

# 不直接从对应的 module 导入,是为了经过 anim_viewer 中对 pyside6 安装的检查
from janim.gui.anim_viewer import FontTable, QWidget, RichTextEditor

Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/__main__.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/anim_viewer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/audio.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/bezier.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/boolean_ops.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
22 changes: 13 additions & 9 deletions janim/locale/source/cli.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,48 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: janim\cli.py:47 janim\cli.py:130
#: janim\cli.py:47 janim\cli.py:134
msgid "Constructing window"
msgstr ""

#: janim\cli.py:58 janim\cli.py:150
#: janim\cli.py:58 janim\cli.py:154
msgid "Finished constructing in {time:.2f} s"
msgstr ""

#: janim\cli.py:165
msgid "\"{file_name}\" doesn't exist"
#: janim\cli.py:127
msgid "No tool specified for use"
msgstr ""

#: janim\cli.py:169
msgid "\"{file_name}\" doesn't exist"
msgstr ""

#: janim\cli.py:173
msgid "\"{file_name}\" isn't a file"
msgstr ""

#: janim\cli.py:189
#: janim\cli.py:193
msgid "No timeline named \"{name}\""
msgstr ""

#: janim\cli.py:215
#: janim\cli.py:219
msgid ""
"That module has multiple timelines, which ones would you like to render?\n"
"Timeline Name or Number: "
msgstr ""

#: janim\cli.py:230
#: janim\cli.py:234
msgid "Invaild number {num}"
msgstr ""

#: janim\cli.py:236
#: janim\cli.py:240
msgid "No timeline named {split_str}"
msgstr ""
2 changes: 1 addition & 1 deletion janim/locale/source/component.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/composition.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/data.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/font.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/font_table.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/item.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/points.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/richtext_editor.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/selector.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/text.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/timeline.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/timeline_view.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/transform.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/typst.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
4 changes: 2 additions & 2 deletions janim/locale/source/updater.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: janim\anims\updater.py:320
#: janim\anims\updater.py:365
msgid ""
"The function passed to ItemUpdater must return an item, but got {ret} "
"instead, defined in {file}:{lineno}"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/vpoints.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion janim/locale/source/writer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Binary file modified janim/locale/zh_CN/LC_MESSAGES/cli.mo
Binary file not shown.
26 changes: 15 additions & 11 deletions janim/locale/zh_CN/LC_MESSAGES/cli.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,52 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:38+0800\n"
"PO-Revision-Date: 2024-06-06 10:41+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: 2024-07-01 11:15+0800\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=GBK\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"X-Generator: Poedit 3.4.2\n"

#: janim\cli.py:47 janim\cli.py:130
#: janim\cli.py:47 janim\cli.py:134
msgid "Constructing window"
msgstr "构建窗口中"

#: janim\cli.py:58 janim\cli.py:150
#: janim\cli.py:58 janim\cli.py:154
msgid "Finished constructing in {time:.2f} s"
msgstr "构建完成,耗时 {time:.2f} s"

#: janim\cli.py:165
#: janim\cli.py:127
msgid "No tool specified for use"
msgstr "未指定所使用的工具"

#: janim\cli.py:169
msgid "\"{file_name}\" doesn't exist"
msgstr "\"{file_name}\" 不存在"

#: janim\cli.py:169
#: janim\cli.py:173
msgid "\"{file_name}\" isn't a file"
msgstr "\"{file_name}\" 不是一个文件"

#: janim\cli.py:189
#: janim\cli.py:193
msgid "No timeline named \"{name}\""
msgstr "没有叫作 \"{name}\" 的 Timeline"

#: janim\cli.py:215
#: janim\cli.py:219
msgid ""
"That module has multiple timelines, which ones would you like to render?\n"
"Timeline Name or Number: "
msgstr ""
"这个 module 中有多个 Timeline,你想要渲染哪些?\n"
"时间轴名称或序号:"

#: janim\cli.py:230
#: janim\cli.py:234
msgid "Invaild number {num}"
msgstr "序号 {num} 无效"

#: janim\cli.py:236
#: janim\cli.py:240
msgid "No timeline named {split_str}"
msgstr "没有叫作 \"{split_str}\" 的 Timeline"
8 changes: 4 additions & 4 deletions janim/locale/zh_CN/LC_MESSAGES/item.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:39+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: 2024-06-22 21:40+0800\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=GBK\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"X-Generator: Poedit 3.4.2\n"

#: janim\items\item.py:203
Expand All @@ -34,5 +34,5 @@ msgid ""
"When root_only is set to True, as_time cannot be specified. Please use \"."
"current(as_time=...).store()\" instead."
msgstr ""
"当 root_only 设置为 True 时,不能设置 as_time,请使用 \"."
"current(as_time=...).store()\" 替代"
"当 root_only 设置为 True 时,不能设置 as_time,请使用 \".current"
"(as_time=...).store()\" 替代"
4 changes: 2 additions & 2 deletions janim/locale/zh_CN/LC_MESSAGES/updater.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-22 21:38+0800\n"
"POT-Creation-Date: 2024-07-01 11:15+0800\n"
"PO-Revision-Date: 2024-06-05 17:42+0800\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand All @@ -17,7 +17,7 @@ msgstr ""
"Language: zh_CN\n"
"X-Generator: Poedit 3.4.2\n"

#: janim\anims\updater.py:320
#: janim\anims\updater.py:365
msgid ""
"The function passed to ItemUpdater must return an item, but got {ret} "
"instead, defined in {file}:{lineno}"
Expand Down

0 comments on commit 99c3e35

Please sign in to comment.