|
18 | 18 | from typing import Callable, List, NamedTuple |
19 | 19 | from urllib.parse import ParseResult |
20 | 20 |
|
21 | | -import procrunner |
22 | | - |
23 | 21 | from murfey.client.tui.status_bar import StatusBar |
24 | 22 | from murfey.util import Observer |
25 | 23 |
|
@@ -433,28 +431,29 @@ def parse_stderr(line: str): |
433 | 431 | result: subprocess.CompletedProcess | None = None |
434 | 432 | success = True |
435 | 433 | if rsync_stdin: |
436 | | - result = procrunner.run( |
| 434 | + result = subprocess.run( |
437 | 435 | rsync_cmd, |
438 | | - callback_stdout=parse_stdout, |
439 | | - callback_stderr=parse_stderr, |
440 | | - working_directory=str(self._basepath), |
441 | | - stdin=rsync_stdin, |
442 | | - print_stdout=False, |
443 | | - print_stderr=False, |
| 436 | + cwd=str(self._basepath), |
| 437 | + capture_output=True, |
| 438 | + input=rsync_stdin, |
444 | 439 | ) |
445 | | - success = result.returncode == 0 if result else False |
| 440 | + for stdout_line in result.stdout.decode("utf8", "replace").split("\n"): |
| 441 | + parse_stdout(stdout_line) |
| 442 | + for stderr_line in result.stderr.decode("utf8", "replace").split("\n"): |
| 443 | + parse_stderr(stderr_line) |
| 444 | + success = result.returncode == 0 |
446 | 445 |
|
447 | 446 | if rsync_stdin_remove: |
448 | 447 | rsync_cmd.insert(-2, "--remove-source-files") |
449 | | - result = procrunner.run( |
| 448 | + result = subprocess.run( |
450 | 449 | rsync_cmd, |
451 | | - callback_stdout=parse_stdout, |
452 | | - callback_stderr=parse_stderr, |
453 | | - working_directory=str(self._basepath), |
454 | | - stdin=rsync_stdin_remove, |
455 | | - print_stdout=False, |
456 | | - print_stderr=False, |
| 450 | + cwd=str(self._basepath), |
| 451 | + input=rsync_stdin_remove, |
457 | 452 | ) |
| 453 | + for stdout_line in result.stdout.decode("utf8", "replace").split("\n"): |
| 454 | + parse_stdout(stdout_line) |
| 455 | + for stderr_line in result.stderr.decode("utf8", "replace").split("\n"): |
| 456 | + parse_stderr(stderr_line) |
458 | 457 |
|
459 | 458 | if success: |
460 | 459 | success = result.returncode == 0 if result else False |
|
0 commit comments