Add support for bpython. #270

Closed
wants to merge 1 commit into
from

Projects

None yet

7 participants

@barraponto
Contributor

bpython is a fancy interface to the Python interpreter, with lots of features like syntax highlight (using pygments), autocomplete and pastebin support.

This is a trivial patch, we might rethink the start_python_console arguments in order to let the user choose which console the user wants. This code defaults to bpython if it is available, falls back to IPython and, finally, python if no fancier interpreter is around.

@stav
Contributor
stav commented Mar 14, 2013

+1 for bpython

@artemdevel
Contributor

maybe better to add a setting into .scrapy.cfg so a user could set preferred console there?

@barraponto
Contributor

@artem-dev yes, I think it'd be great. I thought of adding it to scrapy.cfg but while this makes sense as a project override, it definitely should be set user-wide. I wasn't aware of a .scrapy.cfg though. Cool!

@stav
stav commented on 5676469 Mar 21, 2013

Nice, i like this, works for me.

@nramirezuy
Member

@barraponto Can you fix this PR?

@barraponto
Contributor

Yeah, I'll give it a try. Never dug into scrapy configurations, but I think it'll be a nice experience.

@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 24, 2015
@nyov nyov bpython console: support configuration from scrapy.cfg
example:

cat <<EOF >> ~/.scrapy.cfg
[settings]
console = python
EOF

(closes #270)
511cff9
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 24, 2015
@nyov nyov bpython console: support configuration from scrapy.cfg
example:

cat <<EOF >> ~/.scrapy.cfg
[settings]
console = python
EOF

(closes #270, #1100)
5c0867d
@nyov
Contributor
nyov commented Mar 24, 2015

So I've rebased this and added a scrapy.cfg setting for it. I hope this could get merged now.

@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 25, 2015
@barraponto @nyov barraponto + nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
b8f5846
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 25, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
27f2dfe
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 25, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
fd9ce2c
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 25, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
8ae68e1
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 26, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
924ad56
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 27, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
ad4eadc
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Mar 27, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
0f3d7ef
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Apr 1, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
b5a504a
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Apr 2, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
35dbee0
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Apr 5, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
9701a22
@pablohoffman
Member

shouldn't we give users the option to select which one to use (via setting or something)?. I've used both (have both installed) and feel more comfortable with IPython for Scrapy shell. Milages may vary here.

@dangra
Member
dangra commented Apr 16, 2015

+1 to some way of personal choice like ~/.scrapy.cfg or similar, keeping the default to IPython if installed.

@nramirezuy
Member

@pablohoffman @dangra we have 2 ways in here; we could also support custom shells.

@nyov
Contributor
nyov commented Apr 27, 2015

There are the

~/.scrapy.cfg:
    [settings]
    shell = bpython

and SCRAPY_PYTHON_SHELL=ipython scrapy
options for user configuration now,

with the support for $XDG_CONFIG_HOME from #1098
we also support ~/.config/scrapy.cfg here.

@nyov nyov added a commit to nyov/scrapy that referenced this pull request Apr 27, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
486db0d
@nyov nyov added a commit to nyov/scrapy that referenced this pull request May 15, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
e444e70
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Jul 10, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
34c49fa
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Jul 11, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
e973cf2
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Jul 17, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be used as the interactive python console, if available.
# (default is ipython, fallbacks in the order listed above)
shell = python
EOF

(closes #270, #1100)
8cbaa1c
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Jul 21, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be tried as the interactive python console
# (in above order, unless set here).
shell = python
EOF

(closes #270, #1100, #1301)
877b19c
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Aug 15, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be tried as the interactive python console
# (in above order, unless set here).
shell = python
EOF

(closes #270, #1100, #1301)
c4f5cc9
@nyov nyov added a commit to nyov/scrapy that referenced this pull request Aug 21, 2015
@nyov nyov Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be tried as the interactive python console
# (in above order, unless set here).
shell = python
EOF

(closes #270, #1100, #1301)
2e4591d
@kmike kmike pushed a commit that closed this pull request Aug 27, 2015
@nyov @cyberplant nyov + cyberplant Add support for bpython console.
Adds support for configuration of shells from scrapy.cfg
and SCRAPY_PYTHON_SHELL.

config snippet:

cat <<EOF >> ~/.scrapy.cfg
[settings]
# shell can be one of ipython, bpython or python;
# to be tried as the interactive python console
# (in above order, unless set here).
shell = python
EOF

(closes #270, #1100, #1301)
509cc8d
@kmike kmike closed this in 509cc8d Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment