[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/basic - __init__.py:1.2 configure.zcml:1.2 standardmacros.py:1.2
Jim Fulton
jim@zope.com
Wed, 25 Dec 2002 09:14:11 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/skins/basic
In directory cvs.zope.org:/tmp/cvs-serv15352/src/zope/app/browser/skins/basic
Added Files:
__init__.py configure.zcml standardmacros.py
Log Message:
Grand renaming:
- Renamed most files (especially python modules) to lower case.
- Moved views and interfaces into separate hierarchies within each
project, where each top-level directory under the zope package
is a separate project.
- Moved everything to src from lib/python.
lib/python will eventually go away. I need access to the cvs
repository to make this happen, however.
There are probably some bits that are broken. All tests pass
and zope runs, but I haven't tried everything. There are a number
of cleanups I'll work on tomorrow.
=== Zope3/src/zope/app/browser/skins/basic/__init__.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:11 2002
+++ Zope3/src/zope/app/browser/skins/basic/__init__.py Wed Dec 25 09:12:40 2002
@@ -0,0 +1,2 @@
+#
+# This file is necessary to make this directory a package.
=== Zope3/src/zope/app/browser/skins/basic/configure.zcml 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:11 2002
+++ Zope3/src/zope/app/browser/skins/basic/configure.zcml Wed Dec 25 09:12:40 2002
@@ -0,0 +1,38 @@
+<zopeConfigure
+ xmlns='http://namespaces.zope.org/zope'
+ xmlns:browser='http://namespaces.zope.org/browser'
+>
+
+ <browser:skin name="Basic" layers="default" />
+
+ <browser:view name="standard_macros"
+ permission="zope.View"
+ factory=".standardmacros.StandardMacros"
+ allowed_interface=".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"/>
+
+</zopeConfigure>
=== Zope3/src/zope/app/browser/skins/basic/standardmacros.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:11 2002
+++ Zope3/src/zope/app/browser/skins/basic/standardmacros.py Wed Dec 25 09:12:40 2002
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# 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$
+"""
+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')