[Checkins] SVN: grokui.admin/trunk/s Renamed grokadmin_rename to a more reasonable "rename".

Souheil CHELFOUH souheil at chelfouh.com
Tue Feb 23 18:07:41 EST 2010


Log message for revision 109401:
  Renamed grokadmin_rename to a more reasonable "rename".
  Now that the views are compartmented in the namespace, we do not fear a clash.
  Consistently removed the headers in the tests module. LICENSE.txt should be enough.
  

Changed:
  U   grokui.admin/trunk/setup.py
  U   grokui.admin/trunk/src/grokui/admin/__init__.py
  U   grokui.admin/trunk/src/grokui/admin/interfaces.py
  U   grokui.admin/trunk/src/grokui/admin/templates/rename.pt
  U   grokui.admin/trunk/src/grokui/admin/tests/__init__.py
  U   grokui.admin/trunk/src/grokui/admin/tests/apackage/module1.py
  U   grokui.admin/trunk/src/grokui/admin/tests/apps.py
  U   grokui.admin/trunk/src/grokui/admin/tests/brokenobjs.py
  U   grokui.admin/trunk/src/grokui/admin/tests/events.py
  U   grokui.admin/trunk/src/grokui/admin/tests/infoviews.py
  U   grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py
  U   grokui.admin/trunk/src/grokui/admin/tests/security.py
  U   grokui.admin/trunk/src/grokui/admin/tests/server.py
  U   grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin.py
  U   grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin_functional.py
  U   grokui.admin/trunk/src/grokui/admin/views.py

-=-
Modified: grokui.admin/trunk/setup.py
===================================================================
--- grokui.admin/trunk/setup.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/setup.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -44,6 +44,7 @@
           'ZODB3',
           'grok',
           'grokui.base',
+          'megrok.layout',
           'setuptools',
           'z3c.flashmessage',
           'zope.applicationcontrol',
@@ -56,8 +57,8 @@
           'zope.location',
           'zope.login',
           'zope.schema',
+          'zope.site',
           'zope.size',
-          'zope.site',
           'zope.traversing',
           ],
       tests_require = tests_require,

Modified: grokui.admin/trunk/src/grokui/admin/__init__.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/__init__.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/__init__.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,18 +1,4 @@
 ##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
-# a package
-
 from grokui.admin.interfaces import ISecurityNotifier
 from grokui.admin.utilities import getURLWithParams, getVersion
 from grokui.admin.utilities import (

Modified: grokui.admin/trunk/src/grokui/admin/interfaces.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/interfaces.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/interfaces.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,18 +1,8 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-"""Interfaces for the admin UI."""
+# -*- coding: utf-8 -*-
 
+"""Interfaces for the admin UI.
+"""
+
 from zope.interface import Interface
 from zope.schema import TextLine, Bool
 

Modified: grokui.admin/trunk/src/grokui/admin/templates/rename.pt
===================================================================
--- grokui.admin/trunk/src/grokui/admin/templates/rename.pt	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/templates/rename.pt	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,6 +1,6 @@
 <div>
   <form tal:define="apps context/root/values"
-	tal:attributes="action string:${context/@@absolute_url}/@@grokadmin_rename"
+	tal:attributes="action string:${context/@@absolute_url}/@@rename"
 	method="post">
     <fieldset>
       <legend> Rename applications: </legend>

Modified: grokui.admin/trunk/src/grokui/admin/tests/__init__.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/__init__.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/__init__.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,14 +1 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
 # this is a package

Modified: grokui.admin/trunk/src/grokui/admin/tests/apackage/module1.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/apackage/module1.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/apackage/module1.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,17 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-
 class Klass(object):
     """A class.
     """

Modified: grokui.admin/trunk/src/grokui/admin/tests/apps.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/apps.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/apps.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,17 +1,6 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
 """
+Applications management
+=======================
 
   >>> from zope.testbrowser.testing import Browser
   >>> browser = Browser()
@@ -71,9 +60,8 @@
 
   >>> print browser.contents
   <html xmlns="http://www.w3.org/1999/xhtml">
-  ...
-  <legend> Rename applications: </legend>
-  ...
+  ...<legend> Rename applications: </legend>...
+
   >>> subform = browser.getForm()
   >>> subform.getControl(
   ...     name='new_names:list').value = 'my-new-mammoth-manager'

Modified: grokui.admin/trunk/src/grokui/admin/tests/brokenobjs.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/brokenobjs.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/brokenobjs.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,17 +1,6 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
 """
+Broken objects management
+=========================
 
 The admin-UI now supports detection and deletion of broken objects. It
 is still limited to IApplication objects in the root folder. Options

Modified: grokui.admin/trunk/src/grokui/admin/tests/events.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/events.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/events.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,16 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2009 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.
-#
-##############################################################################
 """
 Events
 ******

Modified: grokui.admin/trunk/src/grokui/admin/tests/infoviews.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/infoviews.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/infoviews.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,16 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
 """
 Information views
 *****************

Modified: grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/packdatabase.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,17 +1,6 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
 """
+ZODB packing
+============
 
 Create a mammoth-manager, and stuff it with data which can be packed.
   >>> from zope.testbrowser.testing import Browser

Modified: grokui.admin/trunk/src/grokui/admin/tests/security.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/security.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/security.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,16 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
 """
 Tests for security notifications.
 

Modified: grokui.admin/trunk/src/grokui/admin/tests/server.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/server.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/server.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,16 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
 """
 Tests for the server functionality of the admin interface.
 

Modified: grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,17 +1,4 @@
-##############################################################################
-#
-# Copyright (c) 2007 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.
-#
-##############################################################################
-"""Setup for tests."""
+# -*- coding: utf-8 -*-
 
 import os
 import unittest

Modified: grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin_functional.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin_functional.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/tests/test_grokadmin_functional.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 import re
 import unittest
 import os.path

Modified: grokui.admin/trunk/src/grokui/admin/views.py
===================================================================
--- grokui.admin/trunk/src/grokui/admin/views.py	2010-02-23 22:40:13 UTC (rev 109400)
+++ grokui.admin/trunk/src/grokui/admin/views.py	2010-02-23 23:07:41 UTC (rev 109401)
@@ -2,13 +2,14 @@
 """Views for the grok admin UI"""
 
 import grok
+import z3c.flashmessage.interfaces
 
 from BTrees.OOBTree import OOBTree
-from grokui.base import IGrokUIRealm, GrokUIView
+from grokui.base import IGrokUIRealm
 from grokui.admin.interfaces import ISecurityNotifier
 from grokui.admin.utilities import getVersion, getURLWithParams
 from grokui.admin.security import MSG_DISABLED
-
+from megrok.layout import Page
 from zope.exceptions import DuplicationError
 from zope.component import getUtility, queryUtility
 
@@ -35,8 +36,8 @@
 
     Call this view via http://localhost:8080/@@admin/@@version to
     get the used grok version. Call
-    http://localhost:8080/@@admin/@@version?pkg=<pkgname> to get
-    the used version of package <pkgname>.
+    http://localhost:8080/++grokui++/@@admin/@@version?pkg=<pkgname>
+    to get the used version of package <pkgname>.
     """
     grok.name('version')
     grok.context(GrokAdminInfoView)
@@ -49,7 +50,7 @@
 class GrokAdminSecurityNotes(grok.View):
     """Display current security notification.
 
-    Call this view via http://localhost:8080/@@admin/@@secnote
+    Call this view via http://localhost:8080/++grokui++/@@admin/@@secnote
     """
     grok.name('secnote')
     grok.context(GrokAdminInfoView)
@@ -140,18 +141,23 @@
             return self.delete(items)
         elif rename is not None:
             return self.redirect(getURLWithParams(
-                    self.url(self.context, '@@grokadmin_rename'),
+                    self.url(self.context, '@@rename'),
                     data=dict(items=items)))
         self.redirect(self.url(self.context, 'applications'))
 
 
-class Rename(GrokUIView):
+class Rename(Page):
     """Rename Grok applications.
     """
-    grok.name('grokadmin_rename')
+    grok.name('rename')
     grok.template('rename')
     grok.require('grok.ManageApplications')
 
+    def flash(self, message, type='message'):
+        source = getUtility(
+            z3c.flashmessage.interfaces.IMessageSource, name='session')
+        source.send(message, type)
+
     def update(self, cancel=None, items=None, new_names=None):
 
         if cancel is not None or not items:



More information about the checkins mailing list