Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Management backend - Base - Config file #37

Merged
merged 15 commits into from
May 10, 2020

Conversation

DoRTaL94
Copy link
Collaborator

fixes #27.
This PR depends on PR #36.
Added config file so the app will auto configured once the flask app starts.

@ahinoamta @RoniRush

Added config file so the app will auto configured once the flask app starts.
@ifireball
Copy link
Collaborator

Unfortunately GitHub makes it close to impossible to properly review PRs that depend on other PRs because it shows all the changes mixed together instead of letting you see only the changes in the relevant PR. So we'll need to merge the first PR before we can review the ones that depend on it (This is why I don't personally consider GitHub to be a serious code review platform).

@DoRTaL94 DoRTaL94 requested a review from ifireball May 3, 2020 11:04
edison/config.py Outdated
if(len(config_dict) == 0):
# Iterating through all config.py members
for name, obj in inspect.getmembers(sys.modules[__name__]):
# We're interested only with the derived classes of the Config class
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're not really checking here is the class you've got is derived from Config, only that is is not the Config class itself

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

edison/config.py Outdated

config_dict = {}

# If config_dict is empty this function builds it dynamically
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the get_config_object function is AFAIK only called once when the Flesk process starts, do you really need to cache the classes in the config_dict? It seems to me you can simplify this code.

Also, please use docstrings to document functions and not comments.

I think the docs for this function need to be improved, its doing non-trivial things like use the inspect module and returning classes. The motivations and techniques for doing this need to be explained. Try to see of your peers that did not write this code can figure out why you wrote it and what it does...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@RoniRush RoniRush requested a review from ifireball May 4, 2020 11:33
edison/config.py Show resolved Hide resolved
edison/config.py Show resolved Hide resolved
RoniRush and others added 2 commits May 10, 2020 10:42
change inspect.isclass(Config) to issubclass(obj, Config)
fixed the wrong checking - if a class is subclass of config
@RoniRush RoniRush requested a review from simzacks May 10, 2020 07:46
@simzacks simzacks merged commit 12ddf41 into redhat-beyond:master May 10, 2020
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.

User Management backend - Base
5 participants