Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Last active October 7, 2023 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongyuwei/42626b4bded6ac16fccb4234154a0a05 to your computer and use it in GitHub Desktop.
Save dongyuwei/42626b4bded6ac16fccb4234154a0a05 to your computer and use it in GitHub Desktop.
PIME dev/debug log

build and compile with Visual Studio 2019(same with the Appveyor CI)

test build in vs studio 2022

  1. mkdir /d/dyw-code/PIME-Cmake-build
  2. cd /d/dyw-code/PIME-Cmake-build
  3. cmake -G "Visual Studio 17 2022" -A x64 ../PIME
  4. open PIME.sln in vs studio 2022
  5. build all or only build PIMETextService
  6. 查看构建产物 D:\dyw-code\PIME-Cmake-build\PIMETextService\Debug\PIMETextService.dll
  7. Install: 参考 https://github.com/EasyIME/PIME#install
  8. CICD build exe 安装文件: https://ci.appveyor.com/project/EasyIME/PIME

PIME作者写的slide

Video

NIME blog

更好的 IPC 架構

EasyIME/forum#11

开发(reload ime service)

参考: EasyIME/PIME#50 已经安装的输入法,如果需要修改生效,则结束node或者python进程即可,会自动重启新进程(在任务管理器在可以查看进程的pid发生了变化)。

自定义输入法UI

参考 https://github.com/EasyIME/emojime/pull/5/files

Log日志(win 11 中可以搜索 %AppData% 快速定位到)

C:\Users<user>\AppData\Local\PIME\Log

@dongyuwei
Copy link
Author

cmake --version
cmake version 3.25.0-rc2

@dongyuwei
Copy link
Author

编译构建重点关注 CI 配置文件: https://github.com/EasyIME/PIME/blob/master/appveyor.yml

@dongyuwei
Copy link
Author

dongyuwei commented Oct 7, 2023

how to use virtualenv to setup a custom python env(so we can use pip packages)

pip3 install virtualenv ## 此处的pip3是系统python3 提供的
virtualenv -V
virtualenv -h

virtualenv --python=./python/python3/python.exe --always-copy python/python3/virtualenv
python/python3/virtualenv/Scripts/python.exe -V

use pip to install marisa-trie

python/python3/virtualenv/Scripts/python.exe -m pip install -U marisa-trie

Then we can use the marisa-trie package in python/python3/virtualenv/Scripts/python.exe:

import marisa_trie
trie = marisa_trie.Trie([u'key1', u'key2', u'key12'])
trie.keys(u'key1')

tips

  1. Remove python\python3\virtualenv\.gitignore
  2. update python.exe path in backends.json, change to python\\python3\\virtualenv\\Scripts\\python.exe
  3. update python.exe path in installer\installer.nsi, change to python\\python3\\virtualenv\\Scripts\\python.exe
  4. update all python3\\pythonw.exe path to python3\\virtualenv\\Scripts\\pythonw.exe

重新构建安装文件并且安装后,在任务管理器中查看python进程,可以打开文件所在位置,即 C:\Program Files (x86)\PIME\python\python3\virtualenv\Scripts\python.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment