Skip to content
Snippets Groups Projects
Unverified Commit 9f5642fd authored by Newbyte's avatar Newbyte :snowflake: Committed by Oliver Smith
Browse files

pmb.helpers.args: Remove please_i_really_need_args() (MR 2442)

All call sites that use this have been removed. This was only introduced
as a stopgap until we could refactor more code to not use args
everywhere, and that has now been achived. As such, remove this so it
doesn't get used in more locations.
parent 657c25c9
No related branches found
No related tags found
1 merge request!2442pmb.helpers.args: Remove please_i_really_need_args()
Pipeline #209048 passed
......@@ -3,12 +3,10 @@
import pmb.config
from pmb.core.context import Context
from pmb.core.pkgrepo import pkgrepo_default_path
from pmb.helpers import logging
from pmb.types import PmbArgs
import pmb.helpers.git
import pmb.helpers.args
__args: PmbArgs = PmbArgs()
"""This file constructs the args variable, which is passed to almost all
functions in the pmbootstrap code base. Here's a listing of the kind of
......@@ -49,7 +47,7 @@ __args: PmbArgs = PmbArgs()
def init(args: PmbArgs) -> PmbArgs:
global __args
args_ = PmbArgs()
# Basic initialization
# print(json.dumps(args.__dict__))
# sys.exit(0)
......@@ -120,14 +118,6 @@ def init(args: PmbArgs) -> PmbArgs:
# Copy all properties from args to out that don't start with underscores
for key, value in vars(args).items():
if not key.startswith("_") and not key == "from_argparse":
setattr(__args, key, value)
setattr(args_, key, value)
return __args
def please_i_really_need_args() -> PmbArgs:
import traceback
traceback.print_stack(file=logging.logfd)
logging.warning("FIXME: retrieved args where it shouldn't be needed!")
return __args
return args_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment