def __init__(self, verbose) -> None: super().__init__() # --------------------------- import 3rd/non-class --------------------------- # import lib.etc as etc import os # ----------------------------- import libraries ----------------------------- # from lib.api import api from lib.detection import detection from lib.data import data from lib.config import config from lib.cli import cli cli = cli(verbose) # ----------------------------- Custom exceptions ---------------------------- # import lib.issue as SPMCLIExceptions self.SPMCLIExceptions = SPMCLIExceptions # -------------------------------- get config -------------------------------- # self.config = config(verbose) # ----------------------- initialise all other classes ----------------------- # self.data = data(verbose) self.os = os self.cli = cli self.etc = etc self.json = etc.getJson() self.api = api(verbose) self.detection = detection(verbose) self.log = cli.verbose self.verbose = verbose
def __init__(self,verbose) -> None: super().__init__() #Set verbose flag self.verbosef = verbose #Import config lib from lib.config import config from lib.detection import detection self.detection = detection(verbose) self.config = config(verbose) self.shipping = self.config.shipping()
def __init__(self, verbose) -> None: super().__init__() #Detection from lib.detection import detection self.detection = detection(verbose) self.verbosef = verbose self.configLocation = self.detection.getPath( '$CONFIG') + 'config' # Config location #Import json using simplejson, and if that fails change to (native) json import lib.etc as etc self.json = etc.getJson()
def __init__(self, verbose) -> None: super().__init__() import os import requests import lib.issue as SPMCLIExceptions import lib.etc as etc from lib.detection import detection from lib.cli import cli self.SPMCLIExceptions = SPMCLIExceptions self.requests = requests self.os = os self.cli = cli(verbose) self.detection = detection(verbose) self.log = self.cli.verbose self.json = etc.getJson()
"First run! Hi there, default configuration generated and saved to ~/.spm/config" ) else: cli.verbose("Config found") cli.verbose(f"Configuration: {config.getConfig()}") # -------------------------------- Import libs ------------------------------- # # # With all dependencies loaded we can now go ahead and load the rest # of the libraries # from lib.api import api from lib.package import package from lib.detection import detection from lib.data import data detection = detection(verbose) data = data(verbose) api = api(verbose) package = package(verbose) # Initialise all other libs # ------------------------ Import custom exception lib ----------------------- # import lib.issue as SPMCLIExceptions # Log out config location cli.verbose(f"Configuration location: {config.configLocation}") # ---------------------------------------------------------------------------- # # Check flags # # ---------------------------------------------------------------------------- #