Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
use grok as import hub and thus rely on grokcore.layout
Browse files Browse the repository at this point in the history
  • Loading branch information
janwijbrand committed Jul 14, 2011
1 parent b62eb04 commit 290c536
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

tests_require = [
'martian',
'grokcore.component',
'zope.annotation',
'zope.app.appsetup',
'zope.app.pagetemplate',
Expand Down Expand Up @@ -55,11 +56,8 @@ def read(*rnames):
namespace_packages = ['grokui'],
install_requires=[
'fanstatic',
'grokcore.component',
'grokcore.layout',
'grok',
'grokcore.message',
'grokcore.view',
'grokcore.viewlet',
'megrok.menu',
'setuptools',
'zope.authentication',
Expand Down
4 changes: 2 additions & 2 deletions src/grokui/base/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ We can build a simple admin screen that fits into the environment like
this:

>>> from martian.testing import FakeModule
>>> import grokcore.viewlet as grok
>>> import grok
>>> from zope.interface import Interface
>>> from grokui.base import GrokUILayer

Expand Down Expand Up @@ -113,7 +113,7 @@ layout automatically, the ``order`` tells at which position in the
menu we want our page to appear. Pages without a title do not appear
in the menu bar at all.

Instances of `GrokUIView` are in fact `grokcore.layout.Page` instances
Instances of `GrokUIView` are in fact `grok.Page` instances
that render the content provided by a template or `render` method
into a given layout (here: the general GrokUI layout).

Expand Down
4 changes: 2 additions & 2 deletions src/grokui/base/contentproviders.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

import grokcore.viewlet as grok
from megrok.menu import Menu
from zope.site.interfaces import IRootFolder
from zope.component import getUtility, getMultiAdapter
from zope.browsermenu.interfaces import IBrowserMenu
import grok
from megrok.menu import Menu
from grokui.base import IGrokUIRealm, GrokUILayer

grok.layer(GrokUILayer)
Expand Down
7 changes: 3 additions & 4 deletions src/grokui/base/layout.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from zope.traversing.browser.absoluteurl import absoluteURL
import grokcore.view as grok
from grokcore.layout import Layout, Page
import grok
from grokui.base import IGrokUIRealm, GrokUILayer, IUIPanel, MainMenu
from grokui.base import resource
import megrok.menu

grok.layer(GrokUILayer)


class GrokUILayout(Layout):
class GrokUILayout(grok.Layout):
"""The general layout for the administration
"""
grok.context(IGrokUIRealm)
Expand All @@ -20,7 +19,7 @@ def update(self):
self.baseurl = absoluteURL(self.context, self.request) + '/'


class GrokUIView(Page):
class GrokUIView(grok.Page):
"""A grok ui view.
"""
grok.baseclass()
Expand Down
3 changes: 1 addition & 2 deletions src/grokui/base/messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import grokcore.component as grok
import grok
from grokcore.message import UniqueMessageSource


Expand Down
3 changes: 1 addition & 2 deletions src/grokui/base/namespace.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
"""Components to keep Grok UI related stuff in a dedicated namespace.
"""
import grokcore.view as grok

from zope.site.interfaces import IRootFolder
from zope.location import LocationProxy
from zope.publisher.browser import applySkin
from zope.publisher.interfaces import browser
from zope.traversing.interfaces import ITraversable
import grok
from grokui.base.interfaces import IGrokUIRealm


Expand Down
4 changes: 2 additions & 2 deletions src/grokui/base/tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
To create a view that automatically comes with the GrokUI layout, we
can derive from `grokui.base.AdminView`.
Instances of `AdminView` are in fact `grokcore.layout.Page` instances
Instances of `AdminView` are in fact `grok.Page` instances
that render the content provided by a template or `render` method
into a given layout.
Expand Down Expand Up @@ -50,7 +50,7 @@
import grokui.base
import unittest
import doctest
import grokcore.component as grok
import grok
from grokui.base import GrokUIView
from zope.fanstatic.testing import ZopeFanstaticBrowserLayer

Expand Down
6 changes: 3 additions & 3 deletions src/grokui/base/viewlets.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

import grokcore.viewlet as grok
from grokui.base import Header, Footer, Messages, IUIPanel, IGrokUIRealm
from grokcore.message.utils import receive
from zope.browsermenu.interfaces import IBrowserMenu
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.component import getUtility
import grok
from grokcore.message.utils import receive
from grokui.base import Header, Footer, Messages, IUIPanel, IGrokUIRealm

grok.view(IUIPanel)
grok.context(IGrokUIRealm)
Expand Down

0 comments on commit 290c536

Please sign in to comment.