Skip to content

Commit

Permalink
修复了一些已知问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mikigo committed Nov 6, 2024
1 parent 5025900 commit 6d40731
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 版本更新记录

## 2.9.0(2024/11/01)

**Fix 🐛**

- 修复远程交互式控制文件描述符占用超限的问题;

## 2.6.9(2024/08/05)

**Fix 🐛**
Expand Down
16 changes: 14 additions & 2 deletions src/cmdctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def sudo_run_cmd(
out_debug_flag: bool = True,
command_log: bool = True,
password: str = None,
return_code=False,
):
if password is None:
password = conf.PASSWORD
Expand All @@ -99,6 +100,7 @@ def sudo_run_cmd(
timeout=timeout,
out_debug_flag=out_debug_flag,
command_log=command_log,
return_code=return_code,
)

@classmethod
Expand All @@ -109,7 +111,9 @@ def run_cmd(
timeout=25,
out_debug_flag=True,
command_log=True,
executable="/bin/bash"
executable="/bin/bash",
return_code=False,
workdir: str = None,
):
"""
执行shell命令
Expand All @@ -120,13 +124,21 @@ def run_cmd(
:param command_log: 执行的命令字符串日志
:return: 返回终端输出
"""
status, out = cls._getstatusoutput(command, timeout=timeout, executable=executable)
wd = ""
if workdir:
workdir = os.path.expanduser(workdir)
if not os.path.exists(workdir):
raise FileNotFoundError
wd = f"cd {workdir} && "
status, out = cls._getstatusoutput(wd + command, timeout=timeout, executable=executable)
if command_log:
logger.debug(command)
if status and interrupt:
raise ShellExecutionFailed(out)
if out_debug_flag and out:
logger.debug(out)
if return_code:
return out, status
return out

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions src/mouse_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def check_chinese():
else:
pyautogui.press(key, interval=interval)

input = input_message

@classmethod
def press_key(cls, key: str, interval=0.0, _ydotool: bool = False):
"""
Expand Down
8 changes: 8 additions & 0 deletions src/shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ def ctrl_a(cls):
"""
cls.hot_key("ctrl", "a")

@classmethod
def ctrl_w(cls):
"""
ctrl_w
:return:
"""
cls.hot_key("ctrl", "w")

@classmethod
def ctrl_l(cls):
"""
Expand Down

0 comments on commit 6d40731

Please sign in to comment.