[Checkins] SVN: Grokstar/trunk/ grokblog is now.... Grokstar!
Martijn Faassen
faassen at infrae.com
Thu Jan 25 16:13:10 EST 2007
Log message for revision 72225:
grokblog is now.... Grokstar!
Changed:
_U Grokstar/trunk/
A Grokstar/trunk/bootstrap/
A Grokstar/trunk/bootstrap/bootstrap.py
A Grokstar/trunk/buildout.cfg
A Grokstar/trunk/setup.py
A Grokstar/trunk/src/
A Grokstar/trunk/src/grokstar/
A Grokstar/trunk/src/grokstar/__init__.py
A Grokstar/trunk/src/grokstar/blog.py
A Grokstar/trunk/src/grokstar/blog_templates/
A Grokstar/trunk/src/grokstar/calendar.py
A Grokstar/trunk/src/grokstar/calendar_templates/
A Grokstar/trunk/src/grokstar/configure.zcml
A Grokstar/trunk/src/grokstar/entry.py
A Grokstar/trunk/src/grokstar/entry_templates/
A Grokstar/trunk/src/grokstar/interfaces.py
-=-
Property changes on: Grokstar/trunk
___________________________________________________________________
Name: svn:ignore
+ develop-eggs
eggs
parts
bin
.installed.cfg
Added: Grokstar/trunk/bootstrap/bootstrap.py
===================================================================
--- Grokstar/trunk/bootstrap/bootstrap.py 2007-01-25 21:13:01 UTC (rev 72224)
+++ Grokstar/trunk/bootstrap/bootstrap.py 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (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.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 69908 2006-08-31 21:53:00Z jim $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Added: Grokstar/trunk/buildout.cfg
===================================================================
--- Grokstar/trunk/buildout.cfg 2007-01-25 21:13:01 UTC (rev 72224)
+++ Grokstar/trunk/buildout.cfg 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1,51 @@
+[buildout]
+develop = .
+parts = zope3 data instance test
+
+[zope3]
+recipe = zc.recipe.cmmi
+extra_options = --with-python=${buildout:executable} --force
+url = http://www.zope.org/Products/Zope3/3.3.0/Zope-3.3.0.tgz
+
+[data]
+recipe = zc.recipe.filestorage
+
+[instance]
+recipe = zc.recipe.zope3instance
+database = data
+user = grok:grok
+eggs = setuptools
+ grok
+ grokstar
+
+zcml = zope.annotation
+ zope.copypastemove
+ zope.formlib
+ zope.i18n-meta
+ zope.i18n.locales
+ zope.publisher
+ zope.security-meta
+ zope.size
+ zope.traversing
+ zope.traversing.browser
+ zope.app
+ zope.app-meta
+ zope.app.securitypolicy
+ zope.app.securitypolicy-meta
+ zope.app.authentication
+ zope.app.catalog
+ zope.app.intid
+ zope.app.keyreference
+ zope.app.twisted
+ grok
+ grok-meta
+ grokstar
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = grokstar
+extra-paths = parts/zope3/src
+working-directory = parts/instance
+defaults = ['--tests-pattern', '^f?tests$',
+ '-v'
+ ]
Added: Grokstar/trunk/setup.py
===================================================================
--- Grokstar/trunk/setup.py 2007-01-25 21:13:01 UTC (rev 72224)
+++ Grokstar/trunk/setup.py 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1,28 @@
+from setuptools import setup, find_packages
+
+version = 0.0
+
+setup(name='Grokstar',
+ version=version,
+ description="",
+ long_description="""\
+""",
+ # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[],
+ keywords="",
+ author="",
+ author_email="",
+ url="",
+ license="",
+ package_dir={'': 'src'},
+ packages=find_packages('src'),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=['setuptools',
+ 'grok',
+ # -*- Extra requirements: -*-
+ ],
+ entry_points="""
+ # -*- Entry points: -*-
+ """,
+ )
Property changes on: Grokstar/trunk/src
___________________________________________________________________
Name: svn:ignore
+ Grokstar.egg-info
Added: Grokstar/trunk/src/grokstar/__init__.py
===================================================================
--- Grokstar/trunk/src/grokstar/__init__.py 2007-01-25 21:13:01 UTC (rev 72224)
+++ Grokstar/trunk/src/grokstar/__init__.py 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1 @@
+# this directory is a package
Copied: Grokstar/trunk/src/grokstar/blog.py (from rev 72223, grok/trunk/grokblog/src/grokblog/blog.py)
Copied: Grokstar/trunk/src/grokstar/blog_templates (from rev 72223, grok/trunk/grokblog/src/grokblog/blog_templates)
Copied: Grokstar/trunk/src/grokstar/calendar.py (from rev 72223, grok/trunk/grokblog/src/grokblog/calendar.py)
Copied: Grokstar/trunk/src/grokstar/calendar_templates (from rev 72223, grok/trunk/grokblog/src/grokblog/calendar_templates)
Added: Grokstar/trunk/src/grokstar/configure.zcml
===================================================================
--- Grokstar/trunk/src/grokstar/configure.zcml 2007-01-25 21:13:01 UTC (rev 72224)
+++ Grokstar/trunk/src/grokstar/configure.zcml 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1,12 @@
+<configure xmlns="http://namespaces.zope.org/grok"
+ xmlns:browser="http://namespaces.zope.org/browser">
+ <grok package="." />
+
+ <browser:addMenuItem
+ class=".blog.Blog"
+ title="Grokstar"
+ description="Grokstar"
+ permission="zope.ManageContent"
+ />
+
+</configure>
Copied: Grokstar/trunk/src/grokstar/entry.py (from rev 72223, grok/trunk/grokblog/src/grokblog/entry.py)
===================================================================
--- grok/trunk/grokblog/src/grokblog/entry.py 2007-01-25 20:40:39 UTC (rev 72223)
+++ Grokstar/trunk/src/grokstar/entry.py 2007-01-25 21:13:09 UTC (rev 72225)
@@ -0,0 +1,68 @@
+from datetime import datetime
+from docutils.core import publish_parts
+
+from zope import schema, interface
+
+import grok
+
+from grokstar.blog import Blog
+from grokstar import interfaces
+
+class Entry(grok.Model):
+ interface.implements(interfaces.IEntry)
+
+ def __init__(self, title, summary, rightsinfo):
+ self.title = title
+ self.updated = datetime.now()
+ self.published = datetime.now()
+ self.summary = summary
+ self.rightsinfo = rightsinfo
+
+class RestructuredTextEntry(Entry):
+ interface.implements(interfaces.IRestructuredTextEntry)
+
+ def __init__(self, title, summary, rightsinfo, content):
+ super(RestructuredTextEntry, self).__init__(title, summary, rightsinfo)
+ self.content = content
+
+grok.context(RestructuredTextEntry)
+
+class AddRest(grok.AddForm):
+ grok.context(Blog)
+
+ form_fields = grok.Fields(
+ id=schema.TextLine(title=u"id"))
+ form_fields += grok.AutoFields(RestructuredTextEntry).omit(
+ 'published', 'updated')
+
+ @grok.action('Add entry')
+ def add(self, id, **data):
+ self.context['entries'][id] = RestructuredTextEntry(**data)
+ self.redirect(self.url(self.context))
+
+class Edit(grok.EditForm):
+ form_fields = grok.AutoFields(RestructuredTextEntry).omit(
+ 'published', 'updated')
+
+ @grok.action('Save changes')
+ def edit(self, **data):
+ self.applyChanges(**data)
+ self.redirect(self.url(self.context))
+
+class RenderedContent(grok.View):
+ def render(self):
+ return renderRest(self.context.content)
+
+rest_settings = {
+ # Disable inclusion of external files, which is a security risk.
+ 'file_insertion_enabled': False,
+ # Disable the promotion of a lone top-level section title to document title
+ # (and disable the promotion of a subsequent section title to document
+ # subtitle).
+ 'doctitle_xform': False
+ }
+
+def renderRest(source):
+ return publish_parts(
+ source, writer_name='html', settings_overrides=rest_settings
+ )['html_body']
Copied: Grokstar/trunk/src/grokstar/entry_templates (from rev 72223, grok/trunk/grokblog/src/grokblog/entry_templates)
Copied: Grokstar/trunk/src/grokstar/interfaces.py (from rev 72223, grok/trunk/grokblog/src/grokblog/interfaces.py)
More information about the Checkins
mailing list