[Checkins] SVN: grokui.admin/trunk/ Updated grokui.admin to work with grok1.1
Souheil CHELFOUH
souheil at chelfouh.com
Wed Dec 2 10:01:12 EST 2009
Log message for revision 106173:
Updated grokui.admin to work with grok1.1
Changed:
U grokui.admin/trunk/buildout.cfg
U grokui.admin/trunk/src/grokui/admin/security.py
U grokui.admin/trunk/src/grokui/admin/tests/apps.py
U grokui.admin/trunk/src/grokui/admin/view.py
D grokui.admin/trunk/versions.cfg
-=-
Modified: grokui.admin/trunk/buildout.cfg
===================================================================
--- grokui.admin/trunk/buildout.cfg 2009-12-02 14:57:28 UTC (rev 106172)
+++ grokui.admin/trunk/buildout.cfg 2009-12-02 15:01:12 UTC (rev 106173)
@@ -3,7 +3,7 @@
parts = test data zopectl app
find-links = http://download.zope.org/distribution/
# Test also with other configs...
-extends = versions.cfg
+extends = http://grok.zope.org/releaseinfo/grok-1.1a1.cfg
versions = versions
[data]
@@ -41,12 +41,9 @@
password="grok"
/>
- <!-- Replace the following directive if you don't want
- public access -->
<grant permission="zope.View"
principal="zope.Anybody" />
- <grant permission="grok.View"
- principal="zope.Anybody" />
+
<grant permission="zope.app.dublincore.view"
principal="zope.Anybody" />
Modified: grokui.admin/trunk/src/grokui/admin/security.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/security.py 2009-12-02 14:57:28 UTC (rev 106172)
+++ grokui.admin/trunk/src/grokui/admin/security.py 2009-12-02 15:01:12 UTC (rev 106173)
@@ -10,8 +10,8 @@
from persistent import Persistent
from zope.component import adapter, provideHandler
+from zope.site.interfaces import IRootFolder
from zope.app.appsetup.interfaces import IDatabaseOpenedWithRootEvent
-from zope.app.folder.interfaces import IRootFolder
from grokui.admin.interfaces import ISecurityNotifier
from grokui.admin.utilities import getVersion, TimeoutableHTTPHandler
Modified: grokui.admin/trunk/src/grokui/admin/tests/apps.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/apps.py 2009-12-02 14:57:28 UTC (rev 106172)
+++ grokui.admin/trunk/src/grokui/admin/tests/apps.py 2009-12-02 15:01:12 UTC (rev 106173)
@@ -111,17 +111,16 @@
"""
import grok
-try:
- from grokcore.view import CodeView as View
-except ImportError:
- from grok import View
-from grokui.admin.view import GrokCoreViewOrCodeView
+
class MammothManager(grok.Application, grok.Container):
- """A mammoth manager"""
+ """A mammoth manager.
+ """
pass
-class Index(View):
+class Index(grok.View):
+ """A Mammoth manager view.
+ """
def render(self):
return u"Let's manage some mammoths!"
Modified: grokui.admin/trunk/src/grokui/admin/view.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/view.py 2009-12-02 14:57:28 UTC (rev 106172)
+++ grokui.admin/trunk/src/grokui/admin/view.py 2009-12-02 15:01:12 UTC (rev 106173)
@@ -22,26 +22,19 @@
from ZODB.broken import Broken
from ZODB.interfaces import IDatabase
from BTrees.OOBTree import OOBTree
+from ZODB.FileStorage.FileStorage import FileStorageError
import zope.component
from zope.interface import Interface
+from zope.exceptions import DuplicationError
+from zope.site.interfaces import IRootFolder
+from zope.authentication.interfaces import IUnauthenticatedPrincipal
+
from zope.app.applicationcontrol.interfaces import IServerControl
from zope.app.applicationcontrol.applicationcontrol import applicationController
from zope.app.applicationcontrol.browser.runtimeinfo import RuntimeInfoView
from zope.app.applicationcontrol.browser.zodbcontrol import ZODBControlView
-from zope.app.folder.interfaces import IRootFolder
-from zope.app.security.interfaces import IUnauthenticatedPrincipal
-from zope.exceptions import DuplicationError
-from ZODB.FileStorage.FileStorage import FileStorageError
-try:
- # For grokcore.view >= 1.9 working sets...
- from grokcore.view import CodeView as GrokCoreViewOrCodeView
-except ImportError:
- # For grokcore.view < 1.9 working sets...
- from grok import View as GrokCoreViewOrCodeView
-
-
grok.context(IRootFolder)
@@ -56,7 +49,7 @@
grok.name('grok.ManageApplications')
-class GrokAdminInfoView(GrokCoreViewOrCodeView):
+class GrokAdminInfoView(grok.View):
"""A base to provide machinereadable views.
"""
grok.name('grokadmin')
@@ -68,11 +61,9 @@
class AdminViewBase(grok.View):
"""A grok.View with a special application_url.
-
We have to compute the application_url different from common
grok.Views, because we have no root application object in the
adminUI. To avoid mismatch, we also call it 'root_url'.
-
"""
grok.baseclass()
@@ -91,7 +82,6 @@
def root_url(self, name=None):
obj = self.context
- result = ""
while obj is not None:
if IRootFolder.providedBy(obj):
return self.url(obj, name)
@@ -100,9 +90,8 @@
-class GrokAdminVersion(GrokCoreViewOrCodeView):
+class GrokAdminVersion(grok.View):
"""Display version of a package.
-
Call this view via http://localhost:8080/@@grokadmin/@@version to
get the used grok version. Call
http://localhost:8080/@@grokadmin/@@version?pkg=<pkgname> to get
@@ -115,9 +104,8 @@
return u'%s %s' % (pkg, getVersion(pkg))
-class GrokAdminSecurityNotes(GrokCoreViewOrCodeView):
+class GrokAdminSecurityNotes(grok.View):
"""Display current security notification.
-
Call this view via http://localhost:8080/@@grokadmin/@@secnote
"""
grok.name('secnote')
@@ -130,10 +118,9 @@
return notifier.getNotification()
-class Add(GrokCoreViewOrCodeView):
+class Add(grok.View):
"""Add an application.
"""
-
grok.require('grok.ManageApplications')
def update(self, inspectapp=None, application=None):
@@ -163,10 +150,9 @@
self.redirect(self.url(self.context))
-class ManageApps(GrokCoreViewOrCodeView):
+class ManageApps(grok.View):
"""Manage applications (delete, rename).
"""
-
grok.require('grok.ManageApplications')
def delete(self, items):
@@ -181,7 +167,6 @@
except AttributeError:
# Object is broken.. Try it the hard way...
# TODO: Try to repair before deleting.
- obj = self.context[name]
if not hasattr(self.context, 'data'):
msg = (
u'%sCould not delete application `%s`: no '
@@ -225,8 +210,8 @@
grok.require('grok.ManageApplications')
def update(self, cancel=None, items=None, new_names=None):
- msg = u''
-
+ """We proceed with the renaming, using the request parameters.
+ """
if cancel is not None:
return self.redirect(self.url(self.context))
Deleted: grokui.admin/trunk/versions.cfg
===================================================================
--- grokui.admin/trunk/versions.cfg 2009-12-02 14:57:28 UTC (rev 106172)
+++ grokui.admin/trunk/versions.cfg 2009-12-02 15:01:12 UTC (rev 106173)
@@ -1,115 +0,0 @@
-# This is a copy of grok/versions.cfg revision 102959.
-#
-# Don't make local modifications here, just override it explicitly in
-# your buildout's [versions] part.
-
-[versions]
-ClientForm = 0.2.9
-grokcore.component = 1.7
-grokcore.formlib = 1.3
-grokcore.security = 1.2
-grokcore.view = 1.11
-grokcore.viewlet = 1.2
-martian = 0.11
-mechanize = 0.1.7b
-pytz = 2007k
-RestrictedPython = 3.4.2
-simplejson = 1.7.1
-z3c.autoinclude = 0.2.2
-z3c.flashmessage = 1.0
-z3c.recipe.eggbasket = 0.4.3
-z3c.testsetup = 0.4
-zc.catalog = 1.2.0
-ZConfig = 2.5.1
-zc.recipe.testrunner = 1.0.0
-zdaemon = 2.0.2
-ZODB3 = 3.8.3
-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.2
-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.9
-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.6
-zope.thread = 3.4
-zope.traversing = 3.4.1
-zope.viewlet = 3.4.2
More information about the checkins
mailing list