-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from HowieHz/dev
1.7.1
- Loading branch information
Showing
26 changed files
with
233 additions
and
56 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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 @@ | ||
[结构介绍](https://hpyculator.readthedocs.io/zh_CN/latest/project_structure.html#hpyc-pyside-ui) |
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,54 @@ | ||
from hpyc_core import Core | ||
from pprint import pprint | ||
import os | ||
|
||
VERSION = "V1.0.0" | ||
yes = ("y", "Y", "YES", "Yes", "yes") | ||
instance_core = Core() | ||
message_queue = instance_core.getMessageQueue() | ||
|
||
if __name__ == "__main__": | ||
os.system("chcp 65001") | ||
print( | ||
f"""\ | ||
插件存放目录: {instance_core.getPluginsDirPath()} | ||
设置文件存放目录: {instance_core.getSettingsDirPath()} | ||
输出目录: {instance_core.getOutputDirPath()} | ||
获取到的插件选项名: """ | ||
) | ||
pprint(tuple(instance_core.getPluginsOptionToId().keys())) | ||
while True: | ||
option = input("输入你想使用的插件的选项名, 如想退出输入exit\n:") | ||
if option == "exit": | ||
print(f"感谢您的使用, hpyc_cli version:{VERSION}") | ||
break | ||
|
||
plugin_id = instance_core.getPluginIdFromOption(option) | ||
|
||
print(f"使用提示:\n{instance_core.getPluginMetadata(plugin_id)['help']}") | ||
|
||
if not input("如想使用此插件请输入 y 否则输入 n\n:") in yes: | ||
continue | ||
rev_input = input(r"请输入待处理数据(如需换行请输入 \n ):") | ||
|
||
if input("如想将结果保存至文件请输入 y 否则输入 n\n:") in yes: | ||
instance_core.eventStartCalculate( | ||
plugin_id=plugin_id, input_data=rev_input, mode="Save" | ||
) | ||
else: | ||
instance_core.eventStartCalculate( | ||
plugin_id=plugin_id, input_data=rev_input, mode="Return" | ||
) | ||
while True: # 消息处理 | ||
rev = message_queue.get() | ||
if rev[0] == "OUTPUT": | ||
print(rev[1]) | ||
elif rev[0] == "ERROR": | ||
print(f"发生了{rev[1]}\n详细错误:{rev[2]}") | ||
break | ||
elif rev[0] == "MESSAGE": | ||
if rev[1] == "CalculationProgramIsRunning": | ||
print("正在计算, 请耐心等待") | ||
elif rev[1] == "CalculationProgramIsFinished": | ||
print(f"计算完毕, 花费了{rev[2]}ns") | ||
break |
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,29 @@ | ||
chcp 65001 | ||
|
||
del -Force ".\out\__main__.dist\*" -Recurse | ||
del -Force ".\out\__main__.dist\" -Recurse | ||
del -Force ".\out\full\*" -Recurse | ||
del -Force ".\out\full\" -Recurse | ||
del -Force ".\out\lite\*" -Recurse | ||
del -Force ".\out\lite\" -Recurse | ||
|
||
nuitka --mingw64 --standalone --quiet --show-progress --show-memory --windows-icon-from-ico=..\use_for_packing\ico.ico --follow-imports --nofollow-import-to=jpype1,jpype,numpy,numba,hpyculator,hpyc_core --enable-plugin=numpy --output-dir=out __main__.py | ||
# --windows-disable-console | ||
|
||
copy-item -path ".\out\__main__.dist" -destination ".\out\lite\bin" -recurse | ||
copy-item -path ".\background_img" -destination ".\out\lite\background_img" -recurse | ||
copy-item -path "..\hpyc_pyside_ui\Plugin" -destination ".\out\lite\Plugin" -recurse | ||
copy-item -path "..\use_for_packing\点我启动.exe" -destination ".\out\lite\点我启动.exe" | ||
|
||
upx --best ".\out\lite\bin\__main__.exe" | ||
|
||
# must | ||
copy-item -path "..\use_for_packing\packing_must\*" -destination ".\out\lite\bin" -recurse | ||
copy-item -path "..\hpyc_core\hpyc_core" -destination ".\out\lite\bin" -recurse | ||
copy-item -path "..\..\hpyculatorPackage\hpyculator" -destination ".\out\lite\bin" -recurse | ||
|
||
# extra | ||
copy-item -path ".\out\lite" -destination ".\out\full" -recurse | ||
copy-item -path "..\use_for_packing\packing_extra\*" -destination ".\out\full\bin" -recurse | ||
|
||
# hpyculator-v1.0.0-cli-win-lite.7z |
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
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
Oops, something went wrong.