nnlogging 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. nnlogging/__init__.py +3 -15
  2. nnlogging/exceptions/__init__.py +15 -0
  3. nnlogging/exceptions/branch_exists.py +29 -0
  4. nnlogging/exceptions/branch_not_found.py +29 -0
  5. nnlogging/exceptions/task_exists.py +31 -0
  6. nnlogging/exceptions/task_not_found.py +29 -0
  7. nnlogging/global_.py +322 -0
  8. nnlogging/options/__init__.py +31 -0
  9. nnlogging/options/branch_config.py +19 -0
  10. nnlogging/options/log_option.py +34 -0
  11. nnlogging/options/logger_config.py +16 -0
  12. nnlogging/options/rich_console.py +44 -0
  13. nnlogging/options/rich_handler.py +47 -0
  14. nnlogging/options/rich_progress.py +62 -0
  15. nnlogging/options/run_config.py +27 -0
  16. nnlogging/options/task_option.py +17 -0
  17. nnlogging/options/track_option.py +19 -0
  18. nnlogging/shell.py +92 -273
  19. nnlogging/shell_funcs/__init__.py +4 -0
  20. nnlogging/shell_funcs/branch_.py +79 -0
  21. nnlogging/{utils/shell_funcs → shell_funcs}/logger_.py +55 -62
  22. nnlogging/shell_funcs/run_.py +84 -0
  23. nnlogging/{utils/shell_funcs → shell_funcs}/task_.py +42 -42
  24. nnlogging/typings/aliases.py +8 -56
  25. nnlogging/typings/exts.py +15 -0
  26. nnlogging/typings/protocols.py +43 -1
  27. nnlogging/utils/factories.py +112 -0
  28. nnlogging/utils/helpers.py +61 -26
  29. {nnlogging-0.1.2.dist-info → nnlogging-0.1.4.dist-info}/METADATA +25 -32
  30. nnlogging-0.1.4.dist-info/RECORD +31 -0
  31. nnlogging/shell_protocol.py +0 -86
  32. nnlogging/typings/__init__.py +0 -41
  33. nnlogging/typings/exceptions.py +0 -10
  34. nnlogging/typings/generics.py +0 -23
  35. nnlogging/utils/__init__.py +0 -83
  36. nnlogging/utils/exception/__init__.py +0 -11
  37. nnlogging/utils/exception/branch_exists.py +0 -49
  38. nnlogging/utils/exception/branch_not_found.py +0 -49
  39. nnlogging/utils/exception/task_exists.py +0 -54
  40. nnlogging/utils/exception/task_not_found.py +0 -49
  41. nnlogging/utils/factory_funcs/rich_.py +0 -154
  42. nnlogging/utils/factory_funcs/shell_.py +0 -192
  43. nnlogging/utils/shell_funcs/branch_.py +0 -164
  44. nnlogging/utils/shell_funcs/run_.py +0 -97
  45. nnlogging-0.1.2.dist-info/RECORD +0 -24
  46. {nnlogging-0.1.2.dist-info → nnlogging-0.1.4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,62 @@
1
+ from collections.abc import Collection
2
+ from dataclasses import dataclass, field
3
+ from typing import TypedDict
4
+
5
+ from rich.progress import ProgressColumn as RichProgressColumn
6
+
7
+
8
+ def get_default_progress_columns():
9
+ from rich.progress import (
10
+ BarColumn,
11
+ SpinnerColumn,
12
+ TaskProgressColumn,
13
+ TextColumn,
14
+ TimeRemainingColumn,
15
+ )
16
+
17
+ spinner_column = SpinnerColumn(
18
+ spinner_name="dots",
19
+ style="progress.spinner",
20
+ finished_text=" ",
21
+ )
22
+ text_column = TextColumn(
23
+ text_format="{task.description}",
24
+ style="progress.description",
25
+ justify="left",
26
+ )
27
+ bar_column = BarColumn(bar_width=40)
28
+ task_progress_column = TaskProgressColumn(
29
+ text_format="{task.percentage:>3.0f}%",
30
+ text_format_no_percentage="",
31
+ style="progress.percentage",
32
+ justify="right",
33
+ show_speed=True,
34
+ )
35
+ time_remaining_column = TimeRemainingColumn(
36
+ compact=False,
37
+ elapsed_when_finished=True,
38
+ )
39
+ return (
40
+ spinner_column,
41
+ text_column,
42
+ bar_column,
43
+ task_progress_column,
44
+ time_remaining_column,
45
+ )
46
+
47
+
48
+ @dataclass(kw_only=True)
49
+ class RichProgressOption:
50
+ columns: Collection[str | RichProgressColumn] = field(
51
+ default_factory=get_default_progress_columns
52
+ )
53
+ transient: bool = field(default=False)
54
+ refresh_per_second: float = field(default=10)
55
+ speed_estimate_period: float = field(default=3600)
56
+
57
+
58
+ class RichProgressOptionDict(TypedDict, total=False):
59
+ columns: Collection[str | RichProgressColumn]
60
+ transient: bool
61
+ refresh_per_second: float
62
+ speed_estimate_period: float
@@ -0,0 +1,27 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import TypedDict
3
+
4
+ from aim import Repo as AimRepo
5
+
6
+
7
+ @dataclass(kw_only=True)
8
+ class RunConfigOption:
9
+ experiment: str | None = field(default=None)
10
+ repo: str | AimRepo | None = field(default=None)
11
+ system_tracking_interval: float | None = field(default=10)
12
+ capture_terminal_logs: bool = field(default=False)
13
+ log_system_params: bool = field(default=False)
14
+ run_hash: str | None = field(default=None)
15
+ read_only: bool = field(default=False)
16
+ force_resume: bool = field(default=False)
17
+
18
+
19
+ class RunConfigOptionDict(TypedDict, total=False):
20
+ experiment: str | None
21
+ repo: str | AimRepo | None
22
+ system_tracking_interval: float | None
23
+ capture_terminal_logs: bool
24
+ log_system_params: bool
25
+ run_hash: str | None
26
+ read_only: bool
27
+ force_resume: bool
@@ -0,0 +1,17 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import TypedDict
3
+
4
+ from nnlogging.typings.exts import NotRequired, Required
5
+
6
+
7
+ @dataclass(kw_only=True)
8
+ class TaskOption:
9
+ description: str = field()
10
+ total: float | None = field()
11
+ completed: float = field(default=0)
12
+
13
+
14
+ class TaskOptionDict(TypedDict):
15
+ description: Required[str]
16
+ total: Required[float | None]
17
+ completed: NotRequired[float]
@@ -0,0 +1,19 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import TypedDict
3
+
4
+ from aim.storage.types import AimObject
5
+
6
+
7
+ @dataclass
8
+ class TrackOption:
9
+ name: str | None = field(default=None)
10
+ step: int | None = field(default=None)
11
+ epoch: int | None = field(default=None)
12
+ context: AimObject = field(default=None)
13
+
14
+
15
+ class TrackOptionDict(TypedDict, total=False):
16
+ name: str | None
17
+ step: int | None
18
+ epoch: int | None
19
+ context: AimObject
nnlogging/shell.py CHANGED
@@ -1,48 +1,24 @@
1
- import sys
2
- from collections.abc import Collection
3
- from logging import Formatter as LoggingFormatter, Logger as LoggingLogger
4
- from typing import Literal, cast
1
+ from logging import Logger as LoggingLogger
2
+ from typing import Literal
5
3
 
6
- from aim import Repo as AimRepo, Run as AimRun
7
- from aim.sdk.types import AimObject
8
- from rich.highlighter import Highlighter as RichHighlighter
9
- from rich.progress import ProgressColumn as RichProgressColumn
10
- from rich.theme import Theme as RichTheme
4
+ from aim import Run as AimRun
5
+ from aim.storage.types import AimObject
11
6
 
12
- from nnlogging.typings import (
13
- Branch,
14
- ConsolePrintOptions,
15
- FormatTimeCallable,
16
- LogOptions,
17
- Omitable,
18
- Sink,
7
+ import nnlogging.shell_funcs as f
8
+ from nnlogging.options import (
9
+ BranchConfigOption,
10
+ BranchConfigOptionDict,
11
+ LoggerConfigOption,
12
+ LoggerConfigOptionDict,
13
+ LogOptionDict,
14
+ RunConfigOption,
15
+ RunConfigOptionDict,
16
+ TaskOptionDict,
17
+ TrackOptionDict,
19
18
  )
20
- from nnlogging.utils import (
21
- BranchConfig,
22
- LoggerConfig,
23
- RunConfig,
24
- add_tag as _add_tag,
25
- advance as _advance,
26
- branch_add as _branch_add,
27
- branch_configure as _branch_configure,
28
- branch_remove as _branch_remove,
29
- critical as _critical,
30
- debug as _debug,
31
- error as _error,
32
- exception as _exception,
33
- info as _info,
34
- log as _log,
35
- logger_configure as _logger_configure,
36
- remove_tag as _remove_tag,
37
- run_configure as _run_configure,
38
- task_add as _task_add,
39
- task_remove as _task_remove,
40
- track as _track,
41
- update_metadata as _update_metadata,
42
- warn as _warn,
43
- )
44
-
45
- global_shell = None
19
+ from nnlogging.typings.aliases import Branch
20
+ from nnlogging.typings.exts import Unpack
21
+ from nnlogging.typings.protocols import Sink
46
22
 
47
23
 
48
24
  class Shell:
@@ -51,175 +27,63 @@ class Shell:
51
27
  shell_name: str = "nnlogging",
52
28
  /,
53
29
  *,
54
- logger_config: LoggerConfig | None = None,
55
- run_config: RunConfig | None = None,
56
- branch_config: BranchConfig | None = None,
30
+ logger_config: LoggerConfigOption | None = None,
31
+ run_config: RunConfigOption | None = None,
32
+ branch_config: BranchConfigOption | None = None,
33
+ strict: bool = False,
57
34
  ):
58
35
  self.logger: LoggingLogger | None = None
59
36
  self.run: AimRun | None = None
60
37
  self.branches: dict[str, Branch] = dict()
61
38
 
62
39
  self.name: str = shell_name
63
- self.logger_config: LoggerConfig = logger_config or LoggerConfig()
64
- self.run_config: RunConfig = run_config or RunConfig()
65
- self.branch_config: BranchConfig = branch_config or BranchConfig()
40
+ self.logger_config: LoggerConfigOption = logger_config or LoggerConfigOption(
41
+ name=shell_name
42
+ )
43
+ self.run_config: RunConfigOption = run_config or RunConfigOption()
44
+ self.branch_config: BranchConfigOption = branch_config or BranchConfigOption()
45
+
46
+ self.strict: bool = strict
66
47
 
67
48
  def logger_configure(
68
49
  self,
69
- config: LoggerConfig | None = None,
70
- /,
71
- *,
72
- name: Omitable[str] = ...,
73
- level: Omitable[int | str] = ...,
74
- propagate: Omitable[bool] = ...,
50
+ **kwargs: Unpack[LoggerConfigOptionDict],
75
51
  ):
76
- _logger_configure(
52
+ f.logger_configure(
77
53
  self,
78
- config,
79
- name=name,
80
- level=level,
81
- propagate=propagate,
54
+ **kwargs,
82
55
  )
83
56
 
84
57
  def run_configure(
85
58
  self,
86
- config: RunConfig | None = None,
87
- /,
88
- *,
89
- experiment: Omitable[str | None] = ...,
90
- repo: Omitable[str | AimRepo | None] = ...,
91
- system_tracking_interval: Omitable[float | None] = ...,
92
- capture_terminal_logs: Omitable[bool] = ...,
93
- log_system_params: Omitable[bool] = ...,
94
- run_hash: Omitable[str | None] = ...,
95
- read_only: Omitable[bool] = ...,
96
- force_resume: Omitable[bool] = ...,
59
+ **kwargs: Unpack[RunConfigOptionDict],
97
60
  ):
98
- _run_configure(
61
+ f.run_configure(
99
62
  self,
100
- config,
101
- experiment=experiment,
102
- repo=repo,
103
- system_tracking_interval=system_tracking_interval,
104
- capture_terminal_logs=capture_terminal_logs,
105
- log_system_params=log_system_params,
106
- run_hash=run_hash,
107
- read_only=read_only,
108
- force_resume=force_resume,
63
+ **kwargs,
109
64
  )
110
65
 
111
66
  def branch_configure(
112
67
  self,
113
- config: BranchConfig | None = None,
114
- /,
115
- *,
116
- markup: Omitable[bool] = ...,
117
- highlighter: Omitable[RichHighlighter] = ...,
118
- width: Omitable[int | None] = ...,
119
- height: Omitable[int | None] = ...,
120
- emoji: Omitable[bool] = ...,
121
- color_system: Omitable[Literal["auto", "standard", "truecolor"] | None] = ...,
122
- theme: Omitable[RichTheme] = ...,
123
- soft_wrap: Omitable[bool] = ...,
124
- force_terminal: Omitable[bool | None] = ...,
125
- force_jupyter: Omitable[bool | None] = ...,
126
- force_interactive: Omitable[bool | None] = ...,
127
- level: Omitable[str | int] = ...,
128
- show_level: Omitable[bool] = ...,
129
- show_time: Omitable[bool] = ...,
130
- show_path: Omitable[bool] = ...,
131
- log_time_format: Omitable[str | FormatTimeCallable] = ...,
132
- omit_repeated_times: Omitable[bool] = ...,
133
- rich_tracebacks: Omitable[bool] = ...,
134
- tracebacks_show_locals: Omitable[bool] = ...,
135
- log_message_format: Omitable[str | LoggingFormatter] = ...,
136
- columns: Omitable[Collection[str | RichProgressColumn]] = ...,
137
- transient: Omitable[bool] = ...,
138
- refresh_per_second: Omitable[float] = ...,
139
- speed_estimate_period: Omitable[float] = ...,
140
- default_column_markup: Omitable[bool] = ...,
68
+ **kwargs: Unpack[BranchConfigOptionDict],
141
69
  ):
142
- _branch_configure(
70
+ f.branch_configure(
143
71
  self,
144
- config,
145
- markup=markup,
146
- highlighter=highlighter,
147
- width=width,
148
- height=height,
149
- emoji=emoji,
150
- color_system=color_system,
151
- theme=theme,
152
- soft_wrap=soft_wrap,
153
- force_terminal=force_terminal,
154
- force_jupyter=force_jupyter,
155
- force_interactive=force_interactive,
156
- level=level,
157
- show_level=show_level,
158
- show_time=show_time,
159
- show_path=show_path,
160
- log_time_format=log_time_format,
161
- omit_repeated_times=omit_repeated_times,
162
- rich_tracebacks=rich_tracebacks,
163
- tracebacks_show_locals=tracebacks_show_locals,
164
- log_message_format=log_message_format,
165
- columns=columns,
166
- transient=transient,
167
- refresh_per_second=refresh_per_second,
168
- speed_estimate_period=speed_estimate_period,
169
- default_column_markup=default_column_markup,
72
+ **kwargs,
170
73
  )
171
74
 
172
75
  def branch_add(
173
76
  self,
174
77
  name: str,
175
78
  /,
176
- sink: Sink | None = None,
177
- *,
178
- markup: Omitable[bool] = ...,
179
- highlighter: Omitable[RichHighlighter] = ...,
180
- width: Omitable[int | None] = ...,
181
- height: Omitable[int | None] = ...,
182
- emoji: Omitable[bool] = ...,
183
- color_system: Omitable[Literal["auto", "standard", "truecolor"] | None] = ...,
184
- theme: Omitable[RichTheme] = ...,
185
- soft_wrap: Omitable[bool] = ...,
186
- force_terminal: Omitable[bool | None] = ...,
187
- force_jupyter: Omitable[bool | None] = ...,
188
- force_interactive: Omitable[bool | None] = ...,
189
- level: Omitable[str | int] = ...,
190
- show_level: Omitable[bool] = ...,
191
- show_time: Omitable[bool] = ...,
192
- show_path: Omitable[bool] = ...,
193
- log_time_format: Omitable[str | FormatTimeCallable] = ...,
194
- omit_repeated_times: Omitable[bool] = ...,
195
- rich_tracebacks: Omitable[bool] = ...,
196
- tracebacks_show_locals: Omitable[bool] = ...,
197
- log_message_format: Omitable[str | LoggingFormatter] = ...,
79
+ sink: Sink | Literal["stderr", "stdout"] = "stderr",
80
+ **kwargs: Unpack[BranchConfigOptionDict],
198
81
  ):
199
- _branch_add(
82
+ f.branch_add(
200
83
  self,
201
84
  name,
202
85
  sink=sink,
203
- markup=markup,
204
- highlighter=highlighter,
205
- width=width,
206
- height=height,
207
- emoji=emoji,
208
- color_system=color_system,
209
- theme=theme,
210
- soft_wrap=soft_wrap,
211
- force_terminal=force_terminal,
212
- force_jupyter=force_jupyter,
213
- force_interactive=force_interactive,
214
- level=level,
215
- show_level=show_level,
216
- show_time=show_time,
217
- show_path=show_path,
218
- log_time_format=log_time_format,
219
- omit_repeated_times=omit_repeated_times,
220
- rich_tracebacks=rich_tracebacks,
221
- tracebacks_show_locals=tracebacks_show_locals,
222
- log_message_format=log_message_format,
86
+ **kwargs,
223
87
  )
224
88
 
225
89
  def branch_remove(
@@ -227,7 +91,7 @@ class Shell:
227
91
  name: str,
228
92
  /,
229
93
  ):
230
- _branch_remove(
94
+ f.branch_remove(
231
95
  self,
232
96
  name,
233
97
  )
@@ -236,17 +100,12 @@ class Shell:
236
100
  self,
237
101
  name: str,
238
102
  /,
239
- *,
240
- desc: str,
241
- total: float | None,
242
- done: float = 0,
103
+ **kwargs: Unpack[TaskOptionDict],
243
104
  ):
244
- _task_add(
105
+ f.task_add(
245
106
  self,
246
107
  name,
247
- desc=desc,
248
- total=total,
249
- done=done,
108
+ **kwargs,
250
109
  )
251
110
 
252
111
  def task_remove(
@@ -254,7 +113,7 @@ class Shell:
254
113
  name: str,
255
114
  /,
256
115
  ):
257
- _task_remove(
116
+ f.task_remove(
258
117
  self,
259
118
  name,
260
119
  )
@@ -264,187 +123,147 @@ class Shell:
264
123
  level: int,
265
124
  msg: object,
266
125
  *args: object,
267
- log_options: LogOptions | None = None,
268
- console_options: ConsolePrintOptions | None = None,
126
+ **kwargs: Unpack[LogOptionDict],
269
127
  ):
270
- _log(
128
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
129
+ f.log(
271
130
  self,
272
131
  level,
273
132
  msg,
274
133
  *args,
275
- log_options=log_options,
276
- console_options=console_options,
134
+ **kwargs,
277
135
  )
278
136
 
279
137
  def debug(
280
138
  self,
281
139
  msg: object,
282
140
  *args: object,
283
- log_options: LogOptions | None = None,
284
- console_options: ConsolePrintOptions | None = None,
141
+ **kwargs: Unpack[LogOptionDict],
285
142
  ):
286
- _debug(
143
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
144
+ f.debug(
287
145
  self,
288
146
  msg,
289
147
  *args,
290
- log_options=log_options,
291
- console_options=console_options,
148
+ **kwargs,
292
149
  )
293
150
 
294
151
  def info(
295
152
  self,
296
153
  msg: object,
297
154
  *args: object,
298
- log_options: LogOptions | None = None,
299
- console_options: ConsolePrintOptions | None = None,
155
+ **kwargs: Unpack[LogOptionDict],
300
156
  ):
301
- _info(
157
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
158
+ f.info(
302
159
  self,
303
160
  msg,
304
161
  *args,
305
- log_options=log_options,
306
- console_options=console_options,
162
+ **kwargs,
307
163
  )
308
164
 
309
165
  def warn(
310
166
  self,
311
167
  msg: object,
312
168
  *args: object,
313
- log_options: LogOptions | None = None,
314
- console_options: ConsolePrintOptions | None = None,
169
+ **kwargs: Unpack[LogOptionDict],
315
170
  ):
316
- _warn(
171
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
172
+ f.warn(
317
173
  self,
318
174
  msg,
319
175
  *args,
320
- log_options=log_options,
321
- console_options=console_options,
176
+ **kwargs,
322
177
  )
323
178
 
324
179
  def error(
325
180
  self,
326
181
  msg: object,
327
182
  *args: object,
328
- log_options: LogOptions | None = None,
329
- console_options: ConsolePrintOptions | None = None,
183
+ **kwargs: Unpack[LogOptionDict],
330
184
  ):
331
- _error(
185
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
186
+ f.error(
332
187
  self,
333
188
  msg,
334
189
  *args,
335
- log_options=log_options,
336
- console_options=console_options,
190
+ **kwargs,
337
191
  )
338
192
 
339
193
  def critical(
340
194
  self,
341
195
  msg: object,
342
196
  *args: object,
343
- log_options: LogOptions | None = None,
344
- console_options: ConsolePrintOptions | None = None,
197
+ **kwargs: Unpack[LogOptionDict],
345
198
  ):
346
- _critical(
199
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
200
+ f.critical(
347
201
  self,
348
202
  msg,
349
203
  *args,
350
- log_options=log_options,
351
- console_options=console_options,
204
+ **kwargs,
352
205
  )
353
206
 
354
207
  def exception(
355
208
  self,
356
209
  msg: object,
357
210
  *args: object,
358
- log_options: LogOptions | None = None,
359
- console_options: ConsolePrintOptions | None = None,
211
+ **kwargs: Unpack[LogOptionDict],
360
212
  ):
361
- _exception(
213
+ kwargs["stacklevel"] = kwargs.get("stacklevel", 2)
214
+ f.exception(
362
215
  self,
363
216
  msg,
364
217
  *args,
365
- log_options=log_options,
366
- console_options=console_options,
218
+ **kwargs,
367
219
  )
368
220
 
369
- def advance(
370
- self,
371
- name: str,
372
- /,
373
- value: float,
374
- ):
375
- _advance(
221
+ def advance(self, name: str, value: float):
222
+ f.advance(
376
223
  self,
377
224
  name,
378
- advance=value,
225
+ value,
379
226
  )
380
227
 
381
228
  def track(
382
229
  self,
383
230
  value: object,
384
231
  /,
385
- name: str | None,
386
- *,
387
- step: int | None,
388
- epoch: int | None,
389
- context: AimObject,
232
+ **kwargs: Unpack[TrackOptionDict],
390
233
  ):
391
- _track(
234
+ f.track(
392
235
  self,
393
236
  value,
394
- name=name,
395
- step=step,
396
- epoch=epoch,
397
- context=context,
237
+ **kwargs,
398
238
  )
399
239
 
400
240
  def add_tag(
401
241
  self,
402
- name: str,
242
+ tag: str,
403
243
  /,
404
244
  ):
405
- _add_tag(
245
+ f.add_tag(
406
246
  self,
407
- name,
247
+ tag,
408
248
  )
409
249
 
410
250
  def remove_tag(
411
251
  self,
412
- name: str,
252
+ tag: str,
413
253
  /,
414
254
  ):
415
- _remove_tag(
255
+ f.remove_tag(
416
256
  self,
417
- name,
257
+ tag,
418
258
  )
419
259
 
420
260
  def update_metadata(
421
261
  self,
422
- name: str,
423
- /,
424
- metadata: AimObject,
262
+ key: str,
263
+ value: AimObject,
425
264
  ):
426
- _update_metadata(
265
+ f.update_metadata(
427
266
  self,
428
- name,
429
- metadata,
267
+ key,
268
+ value,
430
269
  )
431
-
432
-
433
- def get_global_shell(sink: Sink | Literal["stderr", "stdout"] = "stderr"):
434
- global global_shell
435
- if global_shell is None:
436
- global_shell = Shell()
437
- if isinstance(sink, str) and sink in ("stderr", "stdout"):
438
- sink = cast(Sink, getattr(sys, sink))
439
- global_shell.branch_add("default", sink)
440
- global_shell.debug(f'"global_shell" is now initialized as {repr(global_shell)}')
441
- return global_shell
442
-
443
-
444
- def replace_global_shell(shell: Shell):
445
- global global_shell
446
- msg = f'"global_shell" has been replaced from {repr(global_shell)} to {repr(shell)}'
447
- if global_shell is not None:
448
- global_shell.info(msg)
449
- global_shell = shell
450
- global_shell.debug(msg)
@@ -0,0 +1,4 @@
1
+ from .branch_ import *
2
+ from .logger_ import *
3
+ from .run_ import *
4
+ from .task_ import *