[Checkins] SVN: grokui.admin/trunk/ * Adapting this package to use the new version of grokcore.view
Christian Klinger
cklinger at novareto.de
Sat Jul 4 12:32:55 EDT 2009
Log message for revision 101550:
* Adapting this package to use the new version of grokcore.view
which splits View into CodeView.
Changed:
U grokui.admin/trunk/CHANGES.txt
U grokui.admin/trunk/buildout.cfg
U grokui.admin/trunk/setup.py
U grokui.admin/trunk/src/grokui/admin/tests/apps.py
U grokui.admin/trunk/src/grokui/admin/tests/docgrok.py
U grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py
U grokui.admin/trunk/src/grokui/admin/view.py
A grokui.admin/trunk/versions.cfg
-=-
Modified: grokui.admin/trunk/CHANGES.txt
===================================================================
--- grokui.admin/trunk/CHANGES.txt 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/CHANGES.txt 2009-07-04 16:32:55 UTC (rev 101550)
@@ -7,6 +7,9 @@
Feature changes
---------------
+* Adapting this package to use the new version of grokcore.view
+ which splits View into CodeView.
+
* Added a security notifier to inform users when security issues are
published on http://grok.zope.org. The notifier must be explicitly
enabled. You can also run your own site/directory to place security
Modified: grokui.admin/trunk/buildout.cfg
===================================================================
--- grokui.admin/trunk/buildout.cfg 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/buildout.cfg 2009-07-04 16:32:55 UTC (rev 101550)
@@ -3,15 +3,16 @@
parts = test data zopectl app
find-links = http://download.zope.org/distribution/
# Test also with other configs...
-extends = http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+extends = versions.cfg
versions = versions
[data]
recipe = zc.recipe.filestorage
[versions]
-grokui.admin = 0.4dev # Override setting in grok-x.x.cfg
+grokui.admin =
grokcore.security = 1.1
+grokcore.view = 1.9
[app]
recipe = zc.zope3recipes>=0.5.3:application
Modified: grokui.admin/trunk/setup.py
===================================================================
--- grokui.admin/trunk/setup.py 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/setup.py 2009-07-04 16:32:55 UTC (rev 101550)
@@ -40,6 +40,7 @@
install_requires=['setuptools',
'ZODB3',
'grok',
+ 'grokcore.view >= 1.9',
'martian',
'z3c.flashmessage',
'zope.annotation',
Modified: grokui.admin/trunk/src/grokui/admin/tests/apps.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/apps.py 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/src/grokui/admin/tests/apps.py 2009-07-04 16:32:55 UTC (rev 101550)
@@ -122,12 +122,13 @@
"""
import grok
+import grokcore.view
class MammothManager(grok.Application, grok.Container):
"""A mammoth manager"""
pass
-class Index(grok.View):#
+class Index(grokcore.view.CodeView):
def render(self):
return u"Let's manage some mammoths!"
Modified: grokui.admin/trunk/src/grokui/admin/tests/docgrok.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/docgrok.py 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/src/grokui/admin/tests/docgrok.py 2009-07-04 16:32:55 UTC (rev 101550)
@@ -195,6 +195,7 @@
"""
import grok
+import grokcore.view
from grokui.admin.docgrok import DocGrok, DocGrokHandler
from grokui.admin.view import DocGrokView
@@ -228,7 +229,7 @@
return
return DocGrokForMammoths(dotted_path)
-class DocGrokViewForMammoths(grok.View):
+class DocGrokViewForMammoths(grokcore.view.CodeView):
"""A view, that should fit into the other docgrok documentation.
"""
# We bind to the docgrok which provides us with information about
Modified: grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py 2009-07-04 16:32:55 UTC (rev 101550)
@@ -66,12 +66,13 @@
"""
import grok
+import grokcore.view
class StuffedMammoth(grok.Application, grok.Container):
"""A stuffed mammoth"""
stuffing = None
-class Index(grok.View):#
+class Index(grokcore.view.CodeView):#
def update(self, stuffing=None):
if stuffing is not None:
Modified: grokui.admin/trunk/src/grokui/admin/view.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/view.py 2009-07-04 16:29:06 UTC (rev 101549)
+++ grokui.admin/trunk/src/grokui/admin/view.py 2009-07-04 16:32:55 UTC (rev 101550)
@@ -60,14 +60,17 @@
from ZODB.FileStorage.FileStorage import FileStorageError
import z3c.flashmessage.interfaces
+import grokcore.view
+grok.context(IRootFolder)
+def flash(message, type='message'):
+ src = zope.component.getUtility(z3c.flashmessage.interfaces.IMessageSource, name='session')
+ src.send(message, type)
-grok.context(IRootFolder)
-
class ManageApplications(grok.Permission):
grok.name('grok.ManageApplications')
-class GrokAdminInfoView(grok.View):
+class GrokAdminInfoView(grokcore.view.CodeView):
"""A base to provide machinereadable views.
"""
grok.name('grokadmin')
@@ -76,7 +79,7 @@
def render(self):
return u'go to @@version or @@secnotes'
-class GrokAdminVersion(grok.View):
+class GrokAdminVersion(grokcore.view.CodeView):
"""Display version of a package.
Call this view via http://localhost:8080/@@grokadmin/@@version to
@@ -90,7 +93,7 @@
def render(self, pkg='grok'):
return u'%s %s' % (pkg, getVersion(pkg))
-class GrokAdminSecurityNotes(grok.View):
+class GrokAdminSecurityNotes(grokcore.view.CodeView):
"""Display current security notification.
Call this view via http://localhost:8080/@@grokadmin/@@secnote
@@ -104,7 +107,7 @@
notifier = site_manager.queryUtility(ISecurityNotifier, default=None)
return notifier.getNotification()
-class Add(grok.View):
+class Add(grokcore.view.CodeView):
"""Add an application.
"""
@@ -127,15 +130,15 @@
name=application)
try:
self.context[name] = app()
- self.flash(u'Added %s `%s`.' % (application, name))
+ flash(u'Added %s `%s`.' % (application, name))
except DuplicationError:
- self.flash(
+ flash(
u'Name `%s` already in use. Please choose another name.' % (
name,))
self.redirect(self.url(self.context))
-class ManageApps(grok.View):
+class ManageApps(grokcore.view.CodeView):
"""Manage applications (delete, rename).
"""
@@ -169,7 +172,7 @@
msg = (u'%sBroken application `%s` was successfully '
u'deleted.\n' % (msg, name))
- self.flash(msg)
+ flash(msg)
self.redirect(self.url(self.context))
def render(self, rename=None, delete=None, items=None):
@@ -189,7 +192,7 @@
self.redirect(self.url(self.context))
-class GAIAView(grok.View):
+class GAIAViewBase(object):
"""A grok.View with a special application_url.
We have to compute the application_url different from common
@@ -205,7 +208,7 @@
@property
def grokuiadmin_version(self):
return getVersion('grokui.admin')
-
+
def root_url(self, name=None):
obj = self.context
result = ""
@@ -224,6 +227,15 @@
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
+class GAIAView(GAIAViewBase, grok.View):
+ """ Base Class for grok.View"""
+ grok.baseclass()
+
+
+class GAIACodeView(GAIAViewBase, grokcore.view.CodeView):
+ """ Base Class for grokcore.view.CodeView"""
+ grok.baseclass()
+
class GrokAdminMacros(GAIAView):
"""Provides the o-wrap layout."""
@@ -259,15 +271,15 @@
if oldname == newname:
continue
if oldname not in self.context.keys():
- self.flash('Could not rename %s: not found' % oldname)
+ flash('Could not rename %s: not found' % oldname)
continue
if newname in self.context.keys():
- self.flash('`%s` already exists.' % newname)
+ flash('`%s` already exists.' % newname)
continue
self.context[newname] = self.context[oldname]
self.context[newname].__name__ = newname
del self.context[oldname]
- self.flash('Renamed `%s` to `%s`.' % (oldname, newname))
+ flash('Renamed `%s` to `%s`.' % (oldname, newname))
self.redirect(self.url(self.context))
return
@@ -597,7 +609,7 @@
try:
days = int(days)
except ValueError:
- self.flash('Error: Invalid Number')
+ flash('Error: Invalid Number')
return
db = zope.component.getUtility(IDatabase, name=dbName)
print "DB: ", db, days
@@ -605,9 +617,9 @@
return
try:
db.pack(days=days)
- self.flash('ZODB `%s` successfully packed.' % (dbName))
+ flash('ZODB `%s` successfully packed.' % (dbName))
except FileStorageError, err:
- self.flash('ERROR packing ZODB `%s`: %s' % (dbName, err))
+ flash('ERROR packing ZODB `%s`: %s' % (dbName, err))
class Users(GAIAView):
Added: grokui.admin/trunk/versions.cfg
===================================================================
--- grokui.admin/trunk/versions.cfg (rev 0)
+++ grokui.admin/trunk/versions.cfg 2009-07-04 16:32:55 UTC (rev 101550)
@@ -0,0 +1,108 @@
+[versions]
+ClientForm = 0.2.9
+docutils = 0.4
+grokcore.component = 1.5.1
+grokcore.security = 1.1
+martian = 0.11
+mechanize = 0.1.7b
+Pygments = 0.8.1
+pytz = 2007k
+RestrictedPython = 3.4.2
+simplejson = 1.7.1
+z3c.autoinclude = 0.2.2
+z3c.flashmessage = 1.0
+z3c.testsetup = 0.2.1
+zc.catalog = 1.2.0
+ZConfig = 2.5.1
+zc.recipe.testrunner = 1.0.0
+zdaemon = 2.0.2
+ZODB3 = 3.8.1
+zodbcode = 3.4.0
+zope.annotation = 3.4.1
+zope.app.apidoc = 3.4.3
+zope.app.applicationcontrol = 3.4.3
+zope.app.appsetup = 3.4.1
+zope.app.authentication = 3.4.4
+zope.app.basicskin = 3.4.0
+zope.app.broken = 3.4.0
+zope.app.catalog = 3.5.1
+zope.app.component = 3.4.1
+zope.app.container = 3.5.6
+zope.app.content = 3.4.0
+zope.app.debug = 3.4.1
+zope.app.dependable = 3.4.0
+zope.app.error = 3.5.1
+zope.app.exception = 3.4.1
+zope.app.file = 3.4.4
+zope.app.folder = 3.4.0
+zope.app.form = 3.4.1
+zope.app.generations = 3.4.1
+zope.app.http = 3.4.1
+zope.app.i18n = 3.4.4
+zope.app.interface = 3.4.0
+zope.app.intid = 3.4.1
+zope.app.keyreference = 3.4.1
+zope.app.locales = 3.4.5
+zope.app.onlinehelp = 3.4.1
+zope.app.pagetemplate = 3.4.1
+zope.app.preference = 3.4.1
+zope.app.principalannotation = 3.4.0
+zope.app.publication = 3.4.3
+zope.app.publisher = 3.5.1
+zope.app.renderer = 3.4.0
+zope.app.rotterdam = 3.4.1
+zope.app.schema = 3.4.0
+zope.app.security = 3.5.2
+zope.app.securitypolicy = 3.4.6
+zope.app.server = 3.4.2
+zope.app.session = 3.5.1
+zope.app.skins = 3.4.0
+zope.app.testing = 3.4.3
+zope.app.tree = 3.4.0
+zope.app.twisted = 3.4.1
+zope.app.wsgi = 3.4.1
+zope.app.zapi = 3.4.0
+zope.app.zcmlfiles = 3.4.3
+zope.app.zopeappgenerations = 3.4.0
+zope.cachedescriptors = 3.4.1
+zope.component = 3.4.0
+zope.configuration = 3.4.0
+zope.contentprovider = 3.4.0
+zope.contenttype = 3.4.0
+zope.copypastemove = 3.4.0
+zope.datetime = 3.4.0
+zope.deferredimport = 3.4.0
+zope.deprecation = 3.4.0
+zope.dottedname = 3.4.2
+zope.dublincore = 3.4.0
+zope.error = 3.5.1
+zope.event = 3.4.0
+zope.exceptions = 3.4.0
+zope.filerepresentation = 3.4.0
+zope.formlib = 3.4.0
+zope.hookable = 3.4.0
+zope.i18n = 3.4.0
+zope.i18nmessageid = 3.4.3
+zope.index = 3.4.1
+zope.interface = 3.4.1
+zope.lifecycleevent = 3.4.0
+zope.location = 3.4.0
+zope.minmax = 1.1.0
+zope.modulealias = 3.4.0
+zope.pagetemplate = 3.4.0
+zope.proxy = 3.4.2
+zope.publisher = 3.4.6
+zope.schema = 3.4.0
+zope.security = 3.4.1
+zope.securitypolicy = 3.4.1
+zope.server = 3.4.3
+zope.session = 3.4.1
+zope.size = 3.4.0
+zope.structuredtext = 3.4.0
+zope.tal = 3.4.1
+zope.tales = 3.4.0
+zope.testbrowser = 3.4.2
+zope.testing = 3.7.5
+zope.thread = 3.4
+zope.traversing = 3.4.1
+zope.viewlet = 3.4.2
More information about the Checkins
mailing list