-
Notifications
You must be signed in to change notification settings - Fork 107
Refactor and decouple REST api framework #569
Conversation
Great, can you just move the reference to 568 from the title to the PR description? Please put it at the bottom of the description as "Closes #568". Edit: It's common to use imperative style when using Git. So "Moved recording ..." would be "Move recording ...". There's lots of resources online explaining why this is preferred, if you're interested in learning more. |
Regarding the adding "Closes #568" to the description. You should actually add it to your commit message so that it is linked in the commit message back to the issue. Your commit message should look something like Moved recording API endpoints from server.py to recording.py Some detailed description if neccessary Closes #568 |
Yeah, since these commits are squashed that would work (I don't always squash my commits, which is why I rather close it from the PR). Having the reference in both places (i.e. PR description and commit message) would be most convenient, and is simple enough to do. |
FYI, the build failed because of some flake8 errors: @RUNNING: flake8 src
src/freeseer/frontend/controller/__init__.py:3:1: F401 'recording' imported but unused
src/freeseer/frontend/controller/recording.py:200:1: W391 blank line at end of file
src/freeseer/frontend/controller/server.py:90:27: F821 undefined name 'ServerError'
@EXIT WITH STATUS: 1
@FAILING... |
45d5353
to
e842d01
Compare
Looks good. Though there is still room for more refactoring. Like for example since all the endpoints return JSON, it would be nice if there was a decorator that did the transformation automatically and then the endpoint function could simply return a dict. |
737cca2
to
61b6d98
Compare
response.status_code = status_code | ||
return response | ||
except HTTPError as e: | ||
return e.message, e.status_code |
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 needs to also return a response, but with the HTTPError's status code and message.
Edit: Unless Flask already does that when you return a tuple?
869f134
to
7868eed
Compare
@@ -0,0 +1,32 @@ | |||
#!/usr/bin/python | |||
# flake8: noqa |
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.
Looks like this might not be needed anymore.
7868eed
to
71c8b68
Compare
On IRC you mentioned that you fixed the last few things I mentioned, but I don't see any changes. |
71c8b68
to
585d953
Compare
Assuming this is already rebased against master, please squash it and I'll do the merge later today. |
585d953
to
ae0aa5f
Compare
@dbrenden Michael's afk right now, but he told me over Hangouts that he wants you to squash it into a single commit since it's all refactoring work. |
bd3fb04
to
131f3ed
Compare
Once the commit message is fixed up I'll merge this. As mentioned on IRC I want a description of what happened, not a list of every single change. |
27972fc
to
50b7376
Compare
Broke out recording api resources, and setup/teardown logic from server.py into its own Blueprint. Implemented decorator in server.py module that carries out http_response object creation and error handling. This decorator is to be used by all endpoints. Updated tests to preserve functionality. Misc logic and style fixes.
50b7376
to
b718476
Compare
Thanks for your contribution! |
The work for #568 is done so it should be closed. On 21 Oct 2014 07:43, "Dennis Ideler" notifications@github.com wrote:
|
The recording API endpoints have been moved from the server.py module to a new class called recording.py.