This repository was archived by the owner on Aug 28, 2020. It is now read-only.
Refactor update_package_manager_data method#143
Open
Deborah-Digges wants to merge 1 commit into
Open
Conversation
42B
reviewed
Oct 28, 2018
|
|
||
| """ | ||
| if 'https://www.nuget.org/packages/SendGrid' == url: | ||
| data["num_total_csharp_downloads"] = self.csharp_downloads(url) |
There was a problem hiding this comment.
Looks like this is indented 4 spaces too far.
| """ | ||
| if 'https://www.nuget.org/packages/SendGrid' == url: | ||
| data["num_total_csharp_downloads"] = self.csharp_downloads(url) | ||
| if 'https://www.nuget.org/packages/SendGrid.CSharp.HTTP.Client' == url: |
There was a problem hiding this comment.
Is there any reason why you wouldn't change some of these to elif statements? If url == 'https://www.nuget.org/packages/SendGrid', it couldn't also be equal to 'https://www.nuget.org/packages/SendGrid.CSharp.HTTP.Client'. All of the checks using == would be prime candidates but some of the if statements which use in would have to be thought about more.
For example, there might be a url which satisfies both of these checks:
if 'pypi' in url and 'sendgrid' in url:
data["num_python_downloads"] = self.python_downloads(url)
if 'pypi' in url and 'python_http_client' in url:
data["num_python_http_client_downloads"] = self.python_downloads(url)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #106
Checklist
Short description of what this PR does:
update_package_manager_datainto 2 methods