Skip to content

Commit

Permalink
进一步移除Windows平台特化的import
Browse files Browse the repository at this point in the history
  • Loading branch information
kanbereina authored Aug 25, 2024
1 parent 07e2b9b commit 8dfbce7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion nonebot_plugin_llob_master/utils/ntqq/ntqq_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import winreg
import os
if os.name == "nt": # 必须为Windos系统
import winreg
from pathlib import Path

from ...config import PluginConfig
Expand Down
4 changes: 3 additions & 1 deletion nonebot_plugin_llob_master/utils/ntqq/ntqq_process.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import asyncio
import subprocess
from pathlib import Path
Expand All @@ -7,7 +8,8 @@
import psutil
from nonebot.log import logger

from ..win32api import *
if os.name == "nt": # 必须为Windos系统
from ..win32api import *
from ...models import ProcessResult


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import ctypes
from ctypes import wintypes
import os
if os.name == "nt": # 必须为Windos系统
from ctypes import wintypes


def get_hwnd_list_by_pid(pid: int):
Expand Down
4 changes: 3 additions & 1 deletion nonebot_plugin_llob_master/utils/win32api/Windows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import ctypes
from ctypes.wintypes import HWND, BOOL, LPCWSTR, SHORT, INT
import os
if os.name == "nt": # 必须为Windos系统
from ctypes.wintypes import HWND, BOOL, LPCWSTR, SHORT, INT

# 加载 user32.dll
user32 = ctypes.WinDLL('user32')
Expand Down

0 comments on commit 8dfbce7

Please sign in to comment.