[IPython-user] Re: Re: ipython as zope interactive console
Jeff Kowalczyk
jtk at yahoo.com
Tue Oct 5 16:09:17 CDT 2004
Fernando Perez wrote:
>> It would be cool to be able to alternate between code-completing in
>> __dict__ or the acquisition environment based on some easily applied
>> trick or magic syntax. Perhaps Object.(tab) -> __dict__ and
>> Object..(tab) -> acquisition, with the second . stripped from the next
>> input prompt. Maybe Object...(tab) could search both, bringing the whole
>> huge attribute list into play.
>
> I'm not really sure what the 'acquisition environment' means. Something
> like this goes beyond what normal ipython can do, since it's obviously a
> zope-specific thing. However, you could certainly extend the ipython
> completion mechanism by inheriting from MagicCompleter in IPython.iplib,
> and then have a zope profile which implements these enhancements in the
> context of zope debugging. That's the whole point of ipython: it exposes
> pretty much all of its internals for problem-specific customization, and
> choosing these customizations is trivial with a profile:
It was a dumb notion on my part; __dict__ is small because it omits the
methods of the Zope object. The available methods are the lion's share of
the attributes:
In [15]: app.Plone.index_html.__dict__
Out[15]:
{'_Access_contents_information_Permission': ['Anonymous',
'Manager',
'Reviewer'],
'_Change_portal_events_Permission': ('Manager', 'Owner'),
'_Modify_portal_content_Permission': ('Manager', 'Owner'),
'_View_Permission': ['Anonymous', 'Manager', 'Reviewer'],
'__ac_local_roles__': {'Administrator': ['Owner']},
'_last_safety_belt': '',
'_last_safety_belt_editor': 'Administrator',
'_safety_belt': 'None',
'contributors': (),
'cooked_text': '<p>You can customize this frontpage by clicking
(snip)</p>\n', 'creation_date': DateTime('2004/09/28 11:33:32.515
GMT-4'), 'description': 'This welcome page is used to introduce you to
the Plone Content Management System.', 'effective_date': None,
'expiration_date': None,
'id': 'index_html',
'language': '',
'modification_date': DateTime('2004/09/28 11:33:32.557 GMT-4'),
'portal_type': 'Document',
'rights': '',
'subject': (),
'text': '\nYou can customize this(snip)\n', 'text_format':
'structured-text',
'title': 'Welcome to Plone',
'workflow_history': {'plone_workflow': ({'action': None, 'review_state':
'visible', 'comments': '', 'actor': 'Administrator', 'time':
DateTime('2004/09/28 11:33:32.521 GMT-4')},)}}
And the whole code-completion starts like this:
In [16]: app.Plone.index_html.
Display all 477 possibilities? (y or n)
app.Plone.index_html.COPY
app.Plone.index_html.COPY__roles__
app.Plone.index_html.Contributors
app.Plone.index_html.Contributors__roles__
app.Plone.index_html.CookedBody
app.Plone.index_html.CookedBody__roles__
app.Plone.index_html.CreationDate
app.Plone.index_html.CreationDate__roles__
app.Plone.index_html.Creator
app.Plone.index_html.Creator__roles__
app.Plone.index_html.DELETE
app.Plone.index_html.DELETE__roles__
app.Plone.index_html.Date
app.Plone.index_html.Date__roles__
app.Plone.index_html.Description
app.Plone.index_html.Description__roles__
app.Plone.index_html.EditableBody
app.Plone.index_html.EditableBody__roles__
app.Plone.index_html.EffectiveDate
app.Plone.index_html.EffectiveDate__roles__
app.Plone.index_html.ExpirationDate
app.Plone.index_html.ExpirationDate__roles__
app.Plone.index_html.Format
app.Plone.index_html.Format__roles__
app.Plone.index_html.HEAD
app.Plone.index_html.HEAD__roles__
app.Plone.index_html.Identifier
app.Plone.index_html.Identifier__roles__
app.Plone.index_html.LOCK
app.Plone.index_html.LOCK__roles__
app.Plone.index_html.Language
app.Plone.index_html.Language__roles__
app.Plone.index_html.MKCOL
app.Plone.index_html.MOVE
app.Plone.index_html.MOVE__roles__
app.Plone.index_html.ModificationDate
app.Plone.index_html.ModificationDate__roles__
app.Plone.index_html.OPTIONS
app.Plone.index_html.OPTIONS__roles__
app.Plone.index_html.PROPFIND
app.Plone.index_html.PROPFIND__roles__
app.Plone.index_html.PROPPATCH
app.Plone.index_html.PROPPATCH__roles__
app.Plone.index_html.PUT
app.Plone.index_html.PUT__roles__
app.Plone.index_html.Publisher
app.Plone.index_html.Publisher__roles__
app.Plone.index_html.REQUEST
app.Plone.index_html.Rights
app.Plone.index_html.Rights__roles__
app.Plone.index_html.SafetyBelt
app.Plone.index_html.SafetyBelt__roles__
app.Plone.index_html.SearchableText
app.Plone.index_html.SearchableText__roles__
app.Plone.index_html.Subject
app.Plone.index_html.Subject__roles__
app.Plone.index_html.TRACE
app.Plone.index_html.TRACE__roles__
app.Plone.index_html.Title
app.Plone.index_html.Title__roles__
app.Plone.index_html.Type
app.Plone.index_html.Type__roles__
app.Plone.index_html.UNLOCK
app.Plone.index_html.UNLOCK__roles__
app.Plone.index_html._Access_contents_information_Permission
app.Plone.index_html._CMFCatalogAware__recurse
app.Plone.index_html._Change_portal_events_Permission
app.Plone.index_html._DefaultDublinCoreImpl__CEILING_DATE
app.Plone.index_html._DefaultDublinCoreImpl__FLOOR_DATE
app.Plone.index_html._Modify_portal_content_Permission
app.Plone.index_html._View_Permission
app.Plone.index_html.__ac_local_roles__
app.Plone.index_html.__ac_permissions__
app.Plone.index_html.__ac_roles__
app.Plone.index_html.__allow_access_to_unprotected_subobjects__
app.Plone.index_html.__basicnew__
app.Plone.index_html.__call__
app.Plone.index_html.__changed__
app.Plone.index_html.__class__
app.Plone.index_html.__class_init__
app.Plone.index_html.__dav_resource__
app.Plone.index_html.__delattr__
app.Plone.index_html.__doc__
app.Plone.index_html.__factory_meta_type__
app.Plone.index_html.__getattr__
app.Plone.index_html.__getstate__
app.Plone.index_html.__http_methods__
app.Plone.index_html.__implements__
(...)
More information about the IPython-user
mailing list