-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
|
I did a cursory review only, of only the changes that were made. The nature of the card you're working on requires that the code review actually cover all of the entire files in the event that there were changes not made that should've been to bring the code base in line with our coding standards - @JohnBrodie or @chrismcguire or another stickler still needs to go over this. ;-) |
aweber_api/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be alphabetized.
|
@mdruger I'll do a more "holistic" review of this Monday, just wanted to get the ball rolling so you aren't blocked. |
|
aweber_api/response.py:30:1: W391 blank line at end of file |
|
There are a few spots in the code like |
|
In We generally try to be as specific as possible with the imports. |
|
|
|
I'm not sure if this is out of scope, but since you're touching the whole codebase, I'll mention it. There are a bunch of "todo"/"we should test this"/"find a better way to do this" in the code, it'd be great if we could make decisions on the comments one way or the other, act on those decisions, and remove the extraneous comments. |
|
@mdruger That's all I got. |
|
Tests fail locally, and on Travis https://travis-ci.org/aweber/AWeber-API-Python-Library/pull_requests |
|
Not sure how this is passing on Travis - the Mock package is being imported, but isn't in miked: ok, for this changeset, I will keep dingus. When the tests are updated, I will replace dingus. |
aweber_api/collection.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to blow up L99 with a TypeError.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rewrite this function
|
For what it's worth, the commits to update to using |
aweber_api/collection.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually catch specific exceptions, not the base Exception type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll catch the AttributeError
|
From flake8: miked: I addressed the collections and missing whitespace issues. Thanks for verifying the imported and unused modules with me. |
aweber_api/entry.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less than ideal. We are taking apart the URL above, and then very slowly and oddly reassembling it, creating a bunch of extra string objects along the way, and throwing in some magic numbers for good measure... Is there not a URL parsing lib we could be using here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The trouble here is that the variable 'url' is a misnomer in this case. We aren't actually manipulating an entire url string that includes the protocol, netloc, path, and all the other parameters that urlparse determines. The url looks something like this '/accounts/1/lists/1'. As awesome as urlparse is, using it here only returns the equivalent path string which has to use the split method to tokenize the string with the '/' delimiter (i.e. url_parts = url.split('/')). I will try a different string manipulation method that hopefully, will be easier to follow. What is even more confusing is that the string manipulation will change depending on whether the host class is an entry or a collection. I found away to place this in the base class, by adding a parameter to acknowledge the different class.
code standard update for __init__ and base class
code standard update for collection class.
code std update for entry class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes preferred over double quotes.
Update code layout to AWeber coding standards.
The edits below are the changes I thought should be made. However, the entire code set should be reviewed to find areas that were missed.