Skip to content
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

[MRG+1] Make scrapy available in shell without explicit import statement #2248

Merged
merged 3 commits into from Sep 17, 2016

Conversation

@redapple
Copy link
Contributor

@redapple redapple commented Sep 15, 2016

Maybe it's just me but I'm always a bit annoyed to have to do import scrapy in the shell.
Thoughts?

@codecov-io
Copy link

@codecov-io codecov-io commented Sep 15, 2016

Current coverage is 83.37% (diff: 66.66%)

Merging #2248 into master will increase coverage by <.01%

Powered by Codecov. Last update 2f60f2a...effaab8

@eliasdorneles eliasdorneles changed the title Make scrapy available in shell without explicit import statement [MRG+1] Make scrapy available in shell without explicit import statement Sep 15, 2016
@eliasdorneles
Copy link
Member

@eliasdorneles eliasdorneles commented Sep 15, 2016

Just tested here, MUCH better! :)

@@ -115,6 +115,9 @@ def fetch(self, request_or_url, spider=None):
self.populate_vars(response, request, spider)

def populate_vars(self, response=None, request=None, spider=None):
import scrapy

self.vars['scrapy'] = scrapy

This comment has been minimized.

@kmike

kmike Sep 15, 2016
Member

I think it worths mentioning in get_help, something like "scrapy is already imported"

This comment has been minimized.

@eliasdorneles

eliasdorneles Sep 15, 2016
Member

+1.

My suggestion:

        b.append("Available Scrapy objects:")
        b.append('  scrapy     scrapy module (contains scrapy.Request, scrapy.Selector, etc)')
        ...

This comment has been minimized.

@redapple

redapple Sep 15, 2016
Author Contributor

+1

@kmike kmike merged commit 992b251 into scrapy:master Sep 17, 2016
1 of 2 checks passed
1 of 2 checks passed
codecov/patch 66.66% of diff hit (target 100%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants