forked from Mirror/pmbootstrap
core: introduce global context (MR 2252)
We can't totally escape the need for some runtime state defined by args. To make the migration easier, introduce a global "Context" class and move some of the read-only global options there. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
b82c4eb167
commit
2a7c769e14
6 changed files with 56 additions and 11 deletions
15
pmb/core/context.py
Normal file
15
pmb/core/context.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Copyright 2024 Caleb Connolly
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
"""Global runtime context"""
|
||||
|
||||
class Context():
|
||||
details_to_stdout: bool
|
||||
quiet: bool
|
||||
command_timeout: float
|
||||
sudo_timer: bool
|
||||
|
||||
def __init__(self):
|
||||
self.details_to_stdout = False
|
||||
self.command_timeout = 0
|
||||
self.sudo_timer = False
|
Loading…
Add table
Add a link
Reference in a new issue