[Checkins] SVN: Sandbox/darrylcousins/mars.macro/s Egg ready
Darryl Cousins
darryl at darrylcousins.net.nz
Fri Jul 13 06:14:50 EDT 2007
Log message for revision 77827:
Egg ready
Changed:
U Sandbox/darrylcousins/mars.macro/setup.py
U Sandbox/darrylcousins/mars.macro/src/mars/macro/README.txt
-=-
Modified: Sandbox/darrylcousins/mars.macro/setup.py
===================================================================
--- Sandbox/darrylcousins/mars.macro/setup.py 2007-07-13 10:06:09 UTC (rev 77826)
+++ Sandbox/darrylcousins/mars.macro/setup.py 2007-07-13 10:14:49 UTC (rev 77827)
@@ -11,11 +11,8 @@
author_email='darryl.cousins at tfws.org.nz',
url='http://www.tfws.org.nz/mars',
description="""\
-Martian is a library that allows the embedding of configuration
-information in Python code. Martian can then grok the system and
-do the appropriate configuration registrations.
-
-This package uses martian to register macros.""",
+This package uses ``martian`` and ``grok`` to register template macros
+for applications built on the ``zope`` framework.""",
long_description=(
read('src/mars/macro/README.txt')
),
@@ -26,70 +23,27 @@
license='ZPL',
dependency_links = ['http://download.zope.org/distribution'],
extras_require = dict(
- test = ['zope.app.appsetup',
- 'zope.app.authentication',
- 'zope.app.component',
- 'zope.app.container',
- 'zope.app.error',
- 'zope.app.form',
- 'zope.app.publisher',
- 'zope.app.publication',
- 'zope.app.security',
- 'zope.app.securitypolicy',
- 'zope.app.twisted',
- 'zope.app.wsgi',
- 'zope.contentprovider',
- 'zope.app.intid',
- 'z3c.formdemo',
- 'z3c.etestbrowser',
- 'zope.app.zcmlfiles',
- 'zope.app.testing',
- 'mars.template'],
- ),
+ test=['zope.app.testing',
+ 'zope.testbrowser',
+ 'zope.app.zcmlfiles',
+ 'zope.app.securitypolicy',
+ 'zope.app.authentication',
+ 'z3c.template',
+ 'mars.template',
+ 'mars.layer',
+ ]
+ ),
install_requires = [
'setuptools',
- 'simplejson',
- 'grok',
- 'martian',
- 'lxml',
- 'pytz',
- 'ZODB3',
- 'z3c.csvvocabulary',
- 'z3c.form',
- 'z3c.formui',
- 'z3c.layer',
- 'z3c.pagelet',
- 'z3c.template',
- 'z3c.viewlet',
- 'z3c.zrtresource',
- 'z3c.formdemo',
- 'zc.resourcelibrary',
- 'zc.table',
- 'zope.annotation',
- 'zope.app.catalog',
- 'zope.app.folder',
- 'zope.app.container',
- 'zope.app.pagetemplate',
- 'zope.app.session',
+ 'zope.app.intid',
+ 'zope.app.catalog',
'zope.component',
'zope.interface',
- 'zope.location',
- 'zope.pagetemplate',
'zope.publisher',
- 'zope.rdb',
- 'zope.schema',
- 'zope.traversing',
+ 'zope.contentprovider',
'zope.viewlet',
+ 'grok',
+ 'martian',
+ 'z3c.macro',
],
)
- # 'zope.app.pagetemplate',
- # 'zope.app.testing',
- # 'zope.configuration',
- # 'zope.dottedname',
- # 'zope.event',
- # 'zope.formlib',
- # 'zope.lifecycleevent',
- # 'zope.security',
- # 'zope.testing',
-
-
Modified: Sandbox/darrylcousins/mars.macro/src/mars/macro/README.txt
===================================================================
--- Sandbox/darrylcousins/mars.macro/src/mars/macro/README.txt 2007-07-13 10:06:09 UTC (rev 77826)
+++ Sandbox/darrylcousins/mars.macro/src/mars/macro/README.txt 2007-07-13 10:14:49 UTC (rev 77827)
@@ -2,10 +2,22 @@
Mars Macro
==========
-Martian is a library that allows the embedding of configuration
-information in Python code. Martian can then grok the system and
-do the appropriate configuration registrations.
+Introduction
+------------
+`Grok`_ is a project which seeks to provide convention over configuration.
+
+``Martian`` grew from `Grok`_:
+
+Martian is a library that allows the embedding of configuration information in
+Python code. Martian can then grok the system and do the appropriate
+configuration registrations.
+
+.. _Grok: http://grok.zope.org/
+
+Mars Viewlet
+------------
+
z3c packages bring significant clarity and a pattern for forms, view and
templates.
@@ -17,20 +29,65 @@
::
class Navigation(mars.macro.MacroFactory):
- """Name defaults to factory.__name__, 'navigation'"""
+ """Name defaults to factory.__name__: 'navigation'"""
grok.template('templates/navigation.pt') # required
grok.context(zope.interface.Interface) # required if no module context
The following tal statement will look up the defined macro and insert its
template.::
- <div metal:use-macro="macro:naviagition" />
+ <div metal:use-macro="macro:navigation" />
-Directives
-----------
+Directives specific to this package
+-----------------------------------
-Please see ``directive.txt``.
+* mars.macro.macro(name):
+ The name of the macro to be used. This allows us to reference
+ the named macro defined with metal:define-macro if we use a
+ different IMacroDirective name.
+* mars.macro.view(class_or_interface):
+ The view for which the macro should be used',
+ Default: IBrowserView
+
+* mars.macro.content_type(name):
+ The content type identifies the type of data.
+ Default: text/html
+
+Also the mars.layer directive may be used
+-----------------------------------------
+
+* mars.layer.layer(class_or_interface):
+ The layer for which the template should be available.
+ This directive can be used at module level
+ Default: zope.publisher.browser.interfaces.IDefaultBrowserLayer
+
+Relevant grok directives
+------------------------
+
+* grok.template(path):
+ This is used different to IGrokDirectives.template. It looks up the file
+ containing the page template using the path relative to the current module, if
+ not found it tries `path` as an absolute path, if not found GrokError is
+ raised. The file should end in extensions ``.pt`` or ``.html``.
+ **Required**
+
+* grok.name(name):
+ The macro name which this macro is registered for. The macro name can be the
+ same defined in metal:define-macro but does not have to be the same. If no
+ macro attribute is given the name is used as the name defined in
+ metal:define-macro. If you need to register a macro under a different name as
+ the defined one, you can use the macro attribute which have to reference the
+ metal.define-macro name. The TALES expression calls macros by this name and
+ returns the macro within the same name or with the name defined in the macro
+ attribute.
+ Default: or **Required**?
+
+* grok.context(class_or_interface):
+ The context for which the macro should be used. Usually should be
+ defined.
+ Default: zope.interface.Interface
+
Tests
-----
More information about the Checkins
mailing list