Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ __pycache__/
/dist
/build/
/usb_util.egg-info

# === local dev artifacts ===
.vscode/
pip.conf
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div align="center">

[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**AiLab Project Documentation**
Expand All @@ -30,7 +30,7 @@ USB-utilは、接続済みのUSBデバイス/BLEデバイスをスキャンし

## 技術仕様・動作環境

- Python: 3.9以降
- Python: 3.10以降(推奨 3.10.18)
- macOS/Linux: libusb 1.0(PyUSBバックエンド)
- Windows: WMIサービス有効な環境(WinUSB/Zadig等不要)
- ネイティブライブラリのビルド/読み込みに必要な環境
Expand Down Expand Up @@ -302,3 +302,24 @@ MIT License

## 作者
- TITManagement 2025


## 対象者
- 運用担当者: 日常運用・手順実行を行う担当者
- 開発者: 機能追加・保守を行う担当者
- 検証担当者: 実機/テスト環境で動作確認を行う担当者

## 依存関係
- Python: `pyproject.toml` の `requires-python` に従う
- 主要ライブラリ: `pyproject.toml` の `dependencies` を参照
- pip index設定: `$AILAB_ROOT/lab_automation_module/config/pip/pip.conf.local` を正本とする

## 最短セットアップ
`bash` / `zsh` で以下を実行。
```bash
export AILAB_ROOT=/path/to/AiLab
export PIP_CONFIG_FILE="$AILAB_ROOT/lab_automation_module/config/pip/pip.conf.local"
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
```
10 changes: 9 additions & 1 deletion core/scanners.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
from .device_models import UsbDeviceSnapshot

AK_COMM_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "..", "..", "lab_automation_api", "libs", "ak_communication")
os.path.join(
os.path.dirname(__file__),
"..",
"..",
"..",
"lab_automation_libs",
"device_drivers",
"ak-communication",
)
)
if AK_COMM_ROOT not in sys.path and os.path.isdir(AK_COMM_ROOT):
sys.path.insert(0, AK_COMM_ROOT)
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ build-backend = "setuptools.build_meta"


[project]
authors = [{ name = "Takaya Inoue" }]
maintainers = [{ name = "AUTO Kobo headquarters" }]
readme = "README.md"
name = "usb-util"
version = "0.1.1"
license = { text = "MIT" }
description = "USB utility helpers"
requires-python = ">=3.8"
requires-python = ">=3.10"
dependencies = [
"customtkinter>=5.2.0",
"Pillow>=10.0.0",
Expand Down
4 changes: 3 additions & 1 deletion usb_util_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import argparse
import os
import sys
from pathlib import Path

from typing import Any, Dict, List, Optional, Tuple

Expand All @@ -40,8 +41,9 @@
USB_JSON_PATH = os.path.join(BASE_DIR, "usb_devices.json")
_SERVICE_SINGLETON: Optional[UsbSnapshotService] = None

AILAB_ROOT = Path(__file__).resolve().parents[2]
AK_GUIPARTS_ROOT = os.path.abspath(
os.path.join(BASE_DIR, "..", "lab_automation_api", "libs", "ak_GUIparts")
str(AILAB_ROOT / "lab_automation_libs" / "gui_parts" / "aist-guiparts")
)
if AK_GUIPARTS_ROOT not in sys.path and os.path.isdir(AK_GUIPARTS_ROOT):
sys.path.insert(0, AK_GUIPARTS_ROOT)
Expand Down