[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/basic - __init__.py:1.1.2.1 configure.zcml:1.1.2.1 standardmacros.py:1.1.2.1
Jim Fulton
jim@zope.com
Mon, 23 Dec 2002 14:31:20 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/skins/basic
In directory cvs.zope.org:/tmp/cvs-serv19908/zope/app/browser/skins/basic
Added Files:
Tag: NameGeddon-branch
__init__.py configure.zcml standardmacros.py
Log Message:
Initial renaming before debugging
=== Added File Zope3/src/zope/app/browser/skins/basic/__init__.py ===
#
# This file is necessary to make this directory a package.
=== Added File Zope3/src/zope/app/browser/skins/basic/configure.zcml ===
<zopeConfigure
xmlns='http://namespaces.zope.org/zope'
xmlns:browser='http://namespaces.zope.org/browser'
>
<browser:menu
id="zmi_views"
title="Menu for displaying alternate representations of an object"
/>
<browser:menu id="zmi_actions"
title="Menu for displaying actions to be performed"
/>
<browser:view name="standard_macros"
permission="Zope.View"
factory="zope.app.browser.skins.basic.standardmacros.StandardMacros"
allowed_interface="zope.app.browser.skins.basic.standardmacros.IStandardMacros"
/>
<browser:view name="view_macros"
permission="Zope.View"
template="www/view_macros.pt"
/>
<browser:view name="dialog_macros"
permission="Zope.View"
template="www/dialog_macros.pt"
/>
<browser:resource name="zopetopBasic.css"
file="www/zopetopBasic.css"
/>
<browser:resource name="zopetopWidgets.css"
file="www/zopetopWidgets.css"
/>
<browser:resource name="zopetopStructure.css"
file="www/zopetopStructure.css"
/>
<browser:resource name="arrowUp.gif" file="www/arrowUp.gif"/>
<include package=".Browser" />
</zopeConfigure>
=== Added File Zope3/src/zope/app/browser/skins/basic/standardmacros.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Standard macros for page templates in the ZMI
The macros are drawn from various different page templates.
$Id: standardmacros.py,v 1.1.2.1 2002/12/23 19:31:18 jim Exp $
"""
from zope.interface import Interface
from zope.component import getView
from zope.publisher.browser import BrowserView
class Macros:
macro_pages = ()
def __getitem__(self, key):
context = self.context
request = self.request
for name in self.macro_pages:
page = getView(context, name, request)
try:
v = page[key]
except KeyError:
pass
else:
return v
raise KeyError, key
class IStandardMacros(Interface):
def __getitem__(key):
"""Return the macro named 'key'"""
class StandardMacros(BrowserView, Macros):
__implements__ = IStandardMacros
macro_pages = ('view_macros', 'dialog_macros')