[Checkins] SVN: Sandbox/darrylcousins/mars.resource/s Egg ready
Darryl Cousins
darryl at darrylcousins.net.nz
Fri Jul 13 06:38:37 EDT 2007
Log message for revision 77833:
Egg ready
Changed:
U Sandbox/darrylcousins/mars.resource/setup.py
U Sandbox/darrylcousins/mars.resource/src/mars/resource/README.txt
U Sandbox/darrylcousins/mars.resource/src/mars/resource/tests/ftesting.zcml
-=-
Modified: Sandbox/darrylcousins/mars.resource/setup.py
===================================================================
--- Sandbox/darrylcousins/mars.resource/setup.py 2007-07-13 10:32:21 UTC (rev 77832)
+++ Sandbox/darrylcousins/mars.resource/setup.py 2007-07-13 10:38:37 UTC (rev 77833)
@@ -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 resources and resource directories.""",
+This package uses ``martian`` and ``grok`` to register resources and resource
+directories for applications built on the ``zope`` framework.""",
long_description=(
read('src/mars/resource/README.txt')
),
@@ -26,71 +23,23 @@
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',
+ '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.contentprovider',
- '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.viewlet',
+ 'zope.app.publisher',
+ 'grok',
+ 'martian',
],
)
- # 'zope.app.pagetemplate',
- # 'zope.app.testing',
- # 'zope.configuration',
- # 'zope.dottedname',
- # 'zope.event',
- # 'zope.formlib',
- # 'zope.lifecycleevent',
- # 'zope.security',
- # 'zope.testing',
-
-
Modified: Sandbox/darrylcousins/mars.resource/src/mars/resource/README.txt
===================================================================
--- Sandbox/darrylcousins/mars.resource/src/mars/resource/README.txt 2007-07-13 10:32:21 UTC (rev 77832)
+++ Sandbox/darrylcousins/mars.resource/src/mars/resource/README.txt 2007-07-13 10:38:37 UTC (rev 77833)
@@ -2,13 +2,22 @@
Mars Resource
=============
-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
+------------
-z3c packages bring significant clarity and a pattern for forms, view and
-templates.
+`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 Resource
+-------------
+
This package uses martian to configure resources and resource directories.
Example Code
@@ -16,13 +25,51 @@
::
- Code
+ # define a file resource
+ class Style(mars.resource.ResourceFactory):
+ grok.name('site.css')
+ mars.resource.file('resources/site.css')
-Directives
-----------
+ # define an image resource
+ class Logo(mars.resource.ResourceFactory):
+ grok.name('logo.jpg')
+ mars.resource.file('resources/logo.jpg')
-Please see ``directive.txt``.
+ # define a resource directory, takes name from factory.__name__
+ class Resources(mars.resource.ResourceDirectoryFactory):
+ mars.resource.directory('resources')
+Directives specific to this package
+-----------------------------------
+
+* mars.resource.file(name):
+ Path to the resource
+ **Required** one only of image or file for Resource
+
+* mars.resource.image(name):
+ Path to the resource
+ **Required** one only of image or file for Resource
+
+* mars.resource.directory(name):
+ Path to the resource directory
+ **Required** for ResourceDirectory
+
+Also the mars.layer directive may be used
+-----------------------------------------
+
+* mars.layer.layer(class_or_interface):
+ The layer for which the template should be available.
+ Default: zope.publisher.browser.interfaces.IDefaultBrowserLayer
+
+Relevant grok directives
+------------------------
+
+* grok.name(name):
+ Name by which resource or resource directory is located
+ **Required**
+
+[And possibly grok.require??]
+
Tests
-----
Modified: Sandbox/darrylcousins/mars.resource/src/mars/resource/tests/ftesting.zcml
===================================================================
--- Sandbox/darrylcousins/mars.resource/src/mars/resource/tests/ftesting.zcml 2007-07-13 10:32:21 UTC (rev 77832)
+++ Sandbox/darrylcousins/mars.resource/src/mars/resource/tests/ftesting.zcml 2007-07-13 10:38:37 UTC (rev 77833)
@@ -2,7 +2,7 @@
xmlns:meta="http://namespaces.zope.org/meta"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="zope"
- package="mars.template.tests">
+ package="mars.resource.tests">
<include package="grok" file="meta.zcml" />
<include package="mars.layer" file="meta.zcml" />
More information about the Checkins
mailing list