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

Refactor of settings.py #142

Merged
merged 2 commits into from
May 27, 2016
Merged

Refactor of settings.py #142

merged 2 commits into from
May 27, 2016

Conversation

Brachi
Copy link
Contributor

@Brachi Brachi commented May 24, 2016

Changed several parts of the code to reduce verbosity and make it a little more readable. No functionality changed. Added 2 TODOs to discuss functions that return a string or None, to either update the docstrings or the functions + the tests


return cert
return cert or None # TODO: Should change rtype docstrings or update tests
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can the docstring be updated? Not sure if changing the return type to be only string is a good idea at this stage.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think is a good idea, let's keep return types (and only change that if strictly necessary)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstrings and removed the TODO comments.

@joac
Copy link

joac commented May 24, 2016

Code looks more pythonic, great job!

@pitbulk
Copy link
Contributor

pitbulk commented May 24, 2016

I implemented that toolkit from the php-saml toolkit and I willfully tried to keep the structure between the toolkits (same with the java and dotnet) in order to help me in the global maintenance. But I think this specific change that you proposed does not affect me to port future changes on the rest of the toolkits.

I will review and merge.

Thanks for contribute! (I will apply those changes also on python3-saml

@Brachi
Copy link
Contributor Author

Brachi commented May 24, 2016

@pitbulk you've done a terrific job maintaining this library in many languages, this PR was just to make it more readable to those used to Python conventions, and I agree the structure should be kept as much as possible (e.g. although in Python getters and setters are not common practice, I'd leave them there).
I will open an issue for discussion first for any changes more than just style.

@pitbulk
Copy link
Contributor

pitbulk commented May 24, 2016

Thanks @Brachi , I read fast your comment and saw the"terrific" word that alarmed me. This is a spanish "false friend".

Thanks for contribute! Sure we can find a balance between portability and python code style :)

@pitbulk pitbulk merged commit f9befb2 into SAML-Toolkits:master May 27, 2016
@pitbulk
Copy link
Contributor

pitbulk commented May 27, 2016

I tried to apply this change to python3-saml and the tests failed. I will need to review if we changed the behavior: https://github.com/onelogin/python3-saml/pull/24/files

@Brachi
Copy link
Contributor Author

Brachi commented May 28, 2016

@pitbulk it seems tests/src/OneLogin/saml2_tests/response_test.py is failing at setup time in both master and the settings_refactor branches. If that test file is removed all other tests pass (including settings_test). Is that the failure you had?

@pitbulk
Copy link
Contributor

pitbulk commented Jun 3, 2016

never mind, the problem was in the tests :)

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.

None yet

3 participants