File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ def record(
156156 seconds : int = typer .Argument (None , help = "Number of seconds to record" ),
157157 config_path : Optional [Path ] = DEFAULT_CONFIG_PATH_OPTION ,
158158 output_folder : Optional [Path ] = DEFAULT_OUTPUT_FOLDER_OPTION ,
159- # TODO pass kwargs to listener. Or make subcommands for each listener
160159 ):
161160 config = get_config (config_path )
162161 recorder = Recorder (config , output_folder )
@@ -170,6 +169,7 @@ def listen(
170169 listener_class : str = LISTENER_CLASS_ARGUMENT ,
171170 config_path : Optional [Path ] = DEFAULT_CONFIG_PATH_OPTION ,
172171 output_folder : Optional [Path ] = DEFAULT_OUTPUT_FOLDER_OPTION ,
172+ # TODO pass kwargs to listener. Or make subcommands for each listener
173173 ):
174174 config = get_config (config_path )
175175 recorder = Recorder (config , output_folder )
Original file line number Diff line number Diff line change 22
33from time import sleep
44from pathlib import Path
5+ from copy import deepcopy
56from typing import Optional
67from typer import progressbar
78from datetime import datetime
@@ -33,14 +34,17 @@ def __init__(
3334 be fully initialized and an additionall call to `setup` will be
3435 required.
3536 """
36- self .config = config
37+ self .input_config = config
38+ self .config = deepcopy (self .input_config )
3739 # Initialize the output folder
3840 self .output_folder = output_folder
3941 self .output_folder .mkdir (parents = True , exist_ok = True )
4042 if setup_name is not False :
4143 self .setup (setup_name )
4244
43- def setup (self , name : Optional [str ] = None ):
45+ def setup (self , name : Optional [str ] = None , reset_config : bool = True ):
46+ if reset_config :
47+ self .config = deepcopy (self .input_config )
4448 # Initialize next recording output
4549 if not name :
4650 name = datetime .now ().strftime ('date_%Y-%m-%d;time_%H-%M-%S' )
You can’t perform that action at this time.
0 commit comments