Skip to content

Commit

Permalink
add bpython info to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed Jul 3, 2016
1 parent 7ac03bb commit b8af99d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
14 changes: 11 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ already have your project's common objects available.

Also you can specify a custom function to run or a string based code block to run, useful to init and configure the objects.

If **ptpython** is installed **manage shell** will load it
Consoles

If **IPython** is installed **manage shell** loads it
:code:`manage shell` can start different consoles by passing the options

Else will use the **default Python console** including support for autocomplete.
- :code:`manage shell --ipython` - This is the default (if ipython installed)
- :code:`manage shell --ptpython`
- :code:`manage shell --bpython`
- :code:`manage shell --python` - This is the **default Python console** including support for autocomplete. (will be default when no other is installed)

The first thing you can do with **manage** is customizing the objects that will be automatically loaded in to shell,
saving you from importing and initializing a lot of stuff every time you need to play with your app via console.
Expand All @@ -77,6 +80,7 @@ Edit **manage.yml** with:
help_text: |
This is the {project_name} interactive shell!
shell:
console: bpython
readline_enabled: true
banner:
enabled: true
Expand Down Expand Up @@ -116,6 +120,10 @@ Check more examples in:

https://github.com/rochacbruno/manage/tree/master/examples/

The famous **naval fate** example (used in docopt and click) is in:

https://github.com/rochacbruno/manage/tree/master/examples/naval/


Custom Commands
===============
Expand Down
3 changes: 2 additions & 1 deletion examples/naval/manage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ shell:
display: true
objects:
- click
- os

banner:
enabled: true
message: Welcome to {project_name} interactive shell
message: Welcome to {project_name} interactive shell - Hello!

readline_enabled: true
5 changes: 4 additions & 1 deletion manage/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ def create_shell(console, manage_dict=None, extra_vars=None):
help='Start with python console')
def shell(console):
"""Runs a Python shell with context"""
return create_shell(MANAGE_DICT.get('console', console), MANAGE_DICT)
return create_shell(
MANAGE_DICT.get('shell', {}).get('console', console),
MANAGE_DICT
)


def load_manage_dict_from_sys_args():
Expand Down

0 comments on commit b8af99d

Please sign in to comment.