please add option to use bpython to collective.recipe.zope2instance

Bug #1027502 reported by Rudd-O
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collective.buildout
New
Undecided
Unassigned

Bug Description

If the bpython module is importable (that is, it does not throw an importerror), then it should say something to the effect that bpython is available, or it should activate the bpython interpreter by default. Either would be VERY useful.

Here is an example of ctl.py with bpython interpreter by default:

    def do_debug(self, arg):
        try:
             import bpython
             maybpython = " ; import bpython ; bpython.embed(locals_=locals())"
        except ImportError:
             maybpython = ""
        cmdline = self.get_startup_cmd(self.options.python,
                                       'import Zope2; app=Zope2.app()%s'%maybpython,
                                       pyflags = '-i', )
        print ('Starting debugger (the name "app" is bound to the top-level '
               'Zope object)')
        os.system(cmdline)

Here is an example of ctl.py with bpython interpreter suggestion:

    def do_debug(self, arg):
        try:
             import bpython
             maybpython = '; you can activate bpython with "import bpython ; bpython.embed(locals_=locals())"'
        except ImportError:
             maybpython = ""
        cmdline = self.get_startup_cmd(self.options.python,
                                       'import Zope2; app=Zope2.app()',
                                       pyflags = '-i', )
        print ('Starting debugger (the name "app" is bound to the top-level '
               'Zope object%s)'%maybpython)
        os.system(cmdline)

Thanks.

Tags: debug
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.