Neutree / COMTool

Cross platform communicate assistant(Serial/network/terminal tool)( 跨平台 串口调试助手 网络调试助手 终端工具 linux windows mac Raspberry Pi )支持插件和二次开发
https://neucrack.com/p/186
GNU Lesser General Public License v3.0
1.71k stars 323 forks source link
assistant debug network plugin protocol python serial tcp terminal tool udp

COMTool

English | 中文

GitHub PyPI GitHub Workflow Status GitHub repo size GitHub Repo stars

GitHub all releases PyPI - Downloads SourceForge

A cross platform serial debug tools written by python


Windows Linux Raspberry Pi macOS
comtool Windows screenshot comtool linux screenshot comtool Raspberry Pi screenshot
White theme Dark theme protocol plugin TCP/UDP Terminal Graph
comtool white theme comtool dark theme comtool protocol plugin tcp udp plugin terminal plugin graph

screenshot maybe the old version, the latest may not the same totally! But better performance、more easy to use and more elegant

Features

Installation

There are two ways to install COMTool:

Install binary

Windows

Linux

Linux has too much version, so we only compile binary for ubuntu. Other distribution please install from pypi or source code. If you have any idea to pack cross platform binary like flatpak or appimage, you can contribute a pull request or add an issue to tell me how to

Arch Linux and its derivative distributions can install from AUR(maintained by taotieren):

# Release version
yay -S python-comtool
# Development version
yay -S python-comtool-git

Rasberry Pi

Open terminal, install dependencies with package manager:

sudo apt install git python3-pyqt5 python3-numpy

Use package manager to install pyqt5 numpy etc. This way makes install easier. If you meet some error when install with pip, you can try to install with package manager first. To find the package name, the trick is to use sudo apt-cache search package_name | grep package_name to search package name, then install it.

Then install other packages with pip:

git clone https://github.com/Neutree/COMTool.git --depth=1
cd COMTool
pip3 install . --verbose
# 或者
# python setup.py bdist_wheel
# sudo pip3 install dist/COMTool-*.*.*-py3-none-any.whl --verbose

then enjoy by command

comtool

macOS

If you want to open multiple comtool, just right click dock icon, then click New Window.

or you can open terminal and type

open -n /Application/comtool.app

or

cd /Applicatioin/comtool.app/Contents/MacOS
./comtool

Because the program is not signed by the developer, it will warn when you open it for the first time. You need to go to Settings -> Security and Privacy -> General to see the prompt comtool and click Open anyway.

Windows defender shows comtool binary is malware?

If your program is download from here, it's ok, the error caused by pack issue, all the source code and pack script is here, even the pack progress is totally automated with github action, no one manually pack.

If you remain have concern, just download source code to run with python or pack yourself.

Of course, if you find a better pack way, please open issue to tell us.

Install python package

For developers or the binary not support your platform's, use this way to install

If no this command, install by

python3 -m ensurepip

for Chinese, you can use tuna mirrors to download faster by:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple comtool

Manually add app to start menu on Linux

Pack binary

pip3 install pyinstaller
python pack.py
cd dist
ls

It's better to create a virtual environment before pack to decrease the size of binary pip install virtualenv virtualenv venv source venv/bin/activate # linux venv/Scripts/activate # windows If you encounter running scripts is disabled on this system, you can temporarily allow the current terminal to execute scripts Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned Then pip install pyinstaller and python pack.py

Development

  1. Install python(>=3.8) and pip3

Linux:

sudo apt install python3 python3-pip

Windows: dowload python3

  1. install packages like pyserial and PyQt5 etc.(list in requirements.txt)
    cd COMTool
    pip3 install -r requirements.txt

On Raspberry, python3-pyqt5 can be install by apt command:

sudo pip3 install --upgrade pyserial
sudo apt install python3-pyqt5
  1. clone project

    git clone https://github.com/Neutree/COMTool.git
  2. code, resolve bugs or add new reatures

Recommended PyCharm IDE or vscode to get start

How to run: Generate translate binary files first(.mo)

python COMTool/i18n.py finish

Then execute main program

python COMTool/Main.py
  1. pull request

Write your own plugins in minutes

see docs/plugins.md

Add translate

Add locale in i18n.py

locales=["en", "zh_CN", "zh_TW", "ja"]

append your language to this list, locales can be found here or wikipedia, zh_CN for example means China Mainland, corresponding language is simplified Chinese characters, zh_TW means China Taiwan, and language is traditional Chinese characters, you can also only use zh to use simplified Chinese characters.

python i18n.py prepare

This command will generate .po files in locales folder

Then translate .po files, this is a standard translate file format which named gettext

to make program read faster, the text files .po should be convert to binary file .mo, just run command:

python i18n.py finish

and then you can see locales/<locale>/LC_MESSAGES/messages.mo file

Run application, you will see the new translation

Create a PR to merge your changes to this repo

Customize theme

In the assets/qss directory under the source code or binary program directory, copy a file from style-dark.qss or style-light.qss, the file name is style-xxx.qss, here xxx is the name of the theme, so that the software can detect the theme. Then modify the qss file according to your preferences. The syntax of qss is similar to css, but the support is not complete. Whether the css syntax can be used depends on the actual effect, haha. Add theme code is welcome!(PR)

In addition, the software has not been deliberately optimized for the theme, and the class and id may have been written casually, so there is no guarantee that future codes will be fully compatible with current qss.

Issue and improvement

Create issue here

License

LGPL-3.0 License

And used these open source projects as libraries:

Donate

If this project helps you, you can buy me a cup of coffee