Skip to content

Conversation

@vshlapakov
Copy link
Contributor

@vshlapakov vshlapakov commented Mar 28, 2017

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:

  • moving proxy logic to a separate module
  • hiding format_iter_filters method
  • dropping iter_raw_* methods
  • minor documentation and docstrings fixes

@vshlapakov vshlapakov self-assigned this Mar 28, 2017
@codecov-io
Copy link

codecov-io commented Mar 28, 2017

Codecov Report

Merging #61 into readthedocs will decrease coverage by 0.01%.
The diff coverage is 93.79%.

Impacted file tree graph

@@               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
Impacted Files Coverage Δ
scrapinghub/client/utils.py 91.46% <ø> (-3.17%) ⬇️
scrapinghub/client/items.py 100% <100%> (ø) ⬆️
scrapinghub/client/jobs.py 83.76% <100%> (+0.13%) ⬆️
scrapinghub/client/spiders.py 97.56% <100%> (-0.06%) ⬇️
scrapinghub/client/requests.py 100% <100%> (ø) ⬆️
scrapinghub/client/frontiers.py 88.79% <100%> (+0.4%) ⬆️
scrapinghub/client/logs.py 96.87% <100%> (+1.63%) ⬆️
scrapinghub/client/exceptions.py 82.25% <100%> (+0.82%) ⬆️
scrapinghub/client/__init__.py 100% <100%> (ø) ⬆️
scrapinghub/client/projects.py 94.59% <100%> (+0.15%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7cafbb...350472e. Read the comment docs.


class _ItemsResourceProxy(_Proxy):

def get(self, _key, **params):
Copy link
Contributor

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/'}

@chekunkov chekunkov merged commit dd1ef8e into readthedocs Mar 29, 2017
@chekunkov chekunkov deleted the readthedocs-proxy branch March 29, 2017 10:51
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.

4 participants