1010import subprocess
1111import sys
1212import time
13- from collections .abc import Callable , Iterator
13+ from collections .abc import Iterator
1414from datetime import date , datetime
1515from enum import Enum
1616from pathlib import Path
@@ -103,10 +103,8 @@ class SysCommandWorker:
103103 def __init__ (
104104 self ,
105105 cmd : str | list [str ],
106- callbacks : dict [str , Any ] | None = None ,
107106 peek_output : bool | None = False ,
108107 environment_vars : dict [str , str ] | None = None ,
109- logfile : None = None ,
110108 working_directory : str | None = './' ,
111109 remove_vt100_escape_codes_from_lines : bool = True
112110 ):
@@ -117,14 +115,12 @@ def __init__(
117115 cmd [0 ] = locate_binary (cmd [0 ])
118116
119117 self .cmd = cmd
120- self .callbacks = callbacks or {}
121118 self .peek_output = peek_output
122119 # define the standard locale for command outputs. For now the C ascii one. Can be overridden
123120 self .environment_vars = {'LC_ALL' : 'C' }
124121 if environment_vars :
125122 self .environment_vars .update (environment_vars )
126123
127- self .logfile = logfile
128124 self .working_directory = working_directory
129125
130126 self .exit_code : int | None = None
@@ -326,17 +322,11 @@ class SysCommand:
326322 def __init__ (
327323 self ,
328324 cmd : str | list [str ],
329- callbacks : dict [str , Callable [[Any ], Any ]] = {},
330- start_callback : Callable [[Any ], Any ] | None = None ,
331325 peek_output : bool | None = False ,
332326 environment_vars : dict [str , str ] | None = None ,
333327 working_directory : str | None = './' ,
334328 remove_vt100_escape_codes_from_lines : bool = True ):
335329
336- self ._callbacks = callbacks .copy ()
337- if start_callback :
338- self ._callbacks ['on_start' ] = start_callback
339-
340330 self .cmd = cmd
341331 self .peek_output = peek_output
342332 self .environment_vars = environment_vars
@@ -386,7 +376,6 @@ def create_session(self) -> bool:
386376
387377 with SysCommandWorker (
388378 self .cmd ,
389- callbacks = self ._callbacks ,
390379 peek_output = self .peek_output ,
391380 environment_vars = self .environment_vars ,
392381 remove_vt100_escape_codes_from_lines = self .remove_vt100_escape_codes_from_lines ,
0 commit comments