-
Notifications
You must be signed in to change notification settings - Fork 61
Convert proxy logic to subclasses #61
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
Conversation
Codecov Report
@@ Coverage Diff @@
## readthedocs #61 +/- ##
===============================================
- Coverage 92.83% 92.81% -0.02%
===============================================
Files 27 28 +1
Lines 1855 1866 +11
===============================================
+ Hits 1722 1732 +10
- Misses 133 134 +1
Continue to review full report at Codecov.
|
scrapinghub/client/proxy.py
Outdated
|
|
||
| class _ItemsResourceProxy(_Proxy): | ||
|
|
||
| def get(self, _key, **params): |
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.
missing docstring
TIL items.get :)
In [7]: job.items.get(0)
Out[7]:
{u'_type': u'Page',
u'referer': None,
u'size': u'24836',
u'title': u'Web Crawling Platform & Data as a Service | Scrapinghub',
u'url': u'https://scrapinghub.com/'}
Make wrap_http_errors private and remove wrap_value_too_large because it's not needed any more.
dc5724c to
c1399be
Compare
As current proxy logic is based on adding a lot of methods in runtime on instantiating entities - all the methods are unavailable in documentation which is a serious drawback. It was decided to replace the approach with a set of subclasses of
_Proxy, each is responsible for its own methods, and other missing methods should be added to target classes.Some side changes in the PR:
format_iter_filtersmethoditer_raw_*methods