[MRG+1] Change Files/ImagesPipelines class attributes to instance attributes #1891
Conversation
f90d071
to
a9753dc
Current coverage is
|
Rebased. I realized the changes were not backward compatible, so I rewrote it. Now it should be 100% backward compatible. Note: If I am not wrong, some parts of the both pipelines were not covered by tests before. The only change I made in those parts was update the class attributes to a instance attribute. As there were no tests for those parts before (if I am not wrong), there are still no tests for it. |
|
||
def __init__(self, store_uri, download_func=None): | ||
def __init__(self, store_uri, settings=None, download_func=None): |
kmike
Mar 30, 2016
Member
Could you please move settings
argument to the end to make it backwards compatible for users who use positional arguments to create FilesPipeline instance?
Could you please move settings
argument to the end to make it backwards compatible for users who use positional arguments to create FilesPipeline instance?
djunzu
Mar 30, 2016
Author
Contributor
And I thought it was backwards compatible...
I will fix it.
And I thought it was backwards compatible...
I will fix it.
@djunzu awesome, thanks for the PR! |
@djunzu ouch, a good call! Some options are still not documented (see http://doc.scrapy.org/en/master/topics/settings.html#settings-documented-elsewhere - not all IMAGE/FILES options have links). But that's not directly related to this PR. If you can fix that it'd be great, but a PR looks good as-is |
modified: tests/test_pipeline_files.py modified: tests/test_pipeline_images.py
modified: scrapy/pipelines/files.py modified: scrapy/pipelines/images.py modified: scrapy/settings/default_settings.py
modified: scrapy/pipelines/files.py modified: tests/test_pipeline_files.py
modified: scrapy/pipelines/images.py
a9753dc
to
2a12876
If we are doing it, let's do it right! |
f1d598b
to
3cabdbf
modified: docs/topics/media-pipeline.rst
3cabdbf
to
6988e9c
Awesome, thanks @djunzu! |
[backport][1.1] Change Files/ImagesPipelines class attributes to instance attributes (PR #1891)
fix #1850
Addressed issues:
FilesPipelines.py
andImagesPipelines.py
tosettings/default_settings.py
FilesPipelines.py
andImagesPipelines.py
to instance attributes. It allows that distinct spiders running together have distinct custom settings for the pipelines.Note: I have no way to test AWS related stuff. So I haven't touched any code related to AWS.
@kmike as you have looked at the issue before, I think you should review the PR.