Collective zc.buildout recipes

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

Reported by Rudd-O on 2012-07-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collective.buildout
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.

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

Other bug subscribers