Skip to content

Update __init__.py to check if client is callable#2

Open
nilsoberg wants to merge 1 commit intokbase-sfa-2021:mainfrom
nilsoberg:clients-callable
Open

Update __init__.py to check if client is callable#2
nilsoberg wants to merge 1 commit intokbase-sfa-2021:mainfrom
nilsoberg:clients-callable

Conversation

@nilsoberg
Copy link

When assigning clients to attributes in the Clients class, check if the value is callable. This allows us to do things like this in the main module Impl file, and pass those objects into the Clients class when creating an object that inherits from Core:

config = dict(
    callback_url=self.callback_url,
    shared_folder=self.shared_folder,
    clients=dict(
        KBaseReport=KBaseReport(self.callback_url, token=self.token),
        DataFileUtil=DataFileUtil(self.callback_url, token=self.token),
        Workspace=Workspace(self.config["workspace-url"], token=self.token)
    ),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant