[Checkins] SVN: grokui.introspector/trunk/src/grokui/introspector/
Refactoring of grokui.introspector:
Martijn Faassen
faassen at infrae.com
Tue Jul 22 09:46:52 EDT 2008
Log message for revision 88687:
Refactoring of grokui.introspector:
* simplify namespace/traversal story somewhat
* code.py provides custom wrappers for Python code to make
it traversable, and allow adapters and views for it
* remove some unused code
Changed:
U grokui.introspector/trunk/src/grokui/introspector/README.txt
U grokui.introspector/trunk/src/grokui/introspector/__init__.py
U grokui.introspector/trunk/src/grokui/introspector/code.py
U grokui.introspector/trunk/src/grokui/introspector/code.txt
D grokui.introspector/trunk/src/grokui/introspector/code_templates/
U grokui.introspector/trunk/src/grokui/introspector/interfaces.py
U grokui.introspector/trunk/src/grokui/introspector/introspector.py
A grokui.introspector/trunk/src/grokui/introspector/namespace.py
U grokui.introspector/trunk/src/grokui/introspector/util.py
U grokui.introspector/trunk/src/grokui/introspector/util.txt
U grokui.introspector/trunk/src/grokui/introspector/views.py
U grokui.introspector/trunk/src/grokui/introspector/views_templates/code.pt
D grokui.introspector/trunk/src/grokui/introspector/views_templates/content.pt
U grokui.introspector/trunk/src/grokui/introspector/views_templates/index.pt
D grokui.introspector/trunk/src/grokui/introspector/views_templates/master.pt
D grokui.introspector/trunk/src/grokui/introspector/views_templates/registries.pt
A grokui.introspector/trunk/src/grokui/introspector/views_templates/registry.pt
-=-
Modified: grokui.introspector/trunk/src/grokui/introspector/README.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/README.txt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/README.txt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -39,16 +39,16 @@
>>> browser.handleErrors = False
All introspector related content is shown in a special skin called
-``introspector``, so that you can enter the follwing URL to access the
+``inspect``, so that you can enter the following URL to access the
overview page::
- >>> browser.open('http://localhost/++introspector++/')
+ >>> browser.open('http://localhost/++inspect++/index')
>>> print browser.contents
<!DOCTYPE html...
<h1>The Grok Introspector</h1>
...
-Note the `++introspector` marker in the URL.
+Note the `++inspect++` marker in the URL.
The overview page provides three main sections to start browsing:
@@ -56,7 +56,7 @@
- code
-- ZODB
+- content
Browsing the registries
=======================
@@ -72,7 +72,7 @@
We get back to introspector home page::
- >>> browser.open('http://localhost/++introspector++/')
+ >>> browser.open('http://localhost/++inspect++/index')
Browsing code (classes, packages, etc.)
@@ -104,7 +104,7 @@
about the ``zope`` package. The link we clicked looks like this::
>>> zope_link
- <Link ... url='http://localhost/++introspector++/code/zope'>
+ <Link ... url='http://localhost/++inspect++/+code/zope'>
This link is translated by the system to the dotted name `zope`, which
means to display the object, whose dotted name is 'zope'.
@@ -113,18 +113,5 @@
We get back to introspector home page::
- >>> browser.open('http://localhost/++introspector++/')
+ >>> browser.open('http://localhost/++inspect++/index')
-
-Browsing the ZODB
-=================
-
- >>> browser.getLink("Browse the content").click()
- >>> print browser.contents
- <!DOCTYPE html...
- <h1>Content browser</h1>
- ...
-
-We get back to introspector home page::
-
- >>> browser.open('http://localhost/++introspector++/')
Modified: grokui.introspector/trunk/src/grokui/introspector/__init__.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/__init__.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/__init__.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -11,7 +11,4 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-# a package
-from grokui.introspector.introspector import Introspector
-from grokui.introspector.views import NAMESPACE
Modified: grokui.introspector/trunk/src/grokui/introspector/code.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/code.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/code.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -14,75 +14,56 @@
"""Introspecting code.
"""
import grok
-from zope.component import getUtility
-from zope.introspector.interfaces import (IObjectInfo, IModuleInfo,
- IPackageInfo,
- IObjectDescriptionProvider,)
-from zope.introspector.objectinfo import ObjectInfo
-from grokui.introspector.interfaces import (IGrokIntrospector,)
-from grokui.introspector.util import dotted_name_url
+from grokcore.component.interfaces import IContext
+import types
+from martian.scan import module_info_from_dotted_name
+from martian.util import isclass
-grok.context(IObjectInfo)
+class Code(object):
+ grok.implements(IContext)
-class Master(grok.View):
- """The Macro page that defines the default look and feel.
- """
+ def __init__(self, dotted_name):
+ self.dotted_name = dotted_name
-class ObjectInfoView(grok.View):
- grok.name('index.html')
+class Index(grok.View):
+ grok.context(Code)
+ def render(self):
+ return "This is code"
- def update(self, *args, **kw):
- self.dotted_name = dotted_name_url(self.context.getDottedName())
-
- def getType(self):
- return self.context.getType().__name__
+class PackageOrModule(Code):
+ def __init__(self, dotted_name):
+ super(PackageOrModule, self).__init__(dotted_name)
+ self._module_info = module_info_from_dotted_name(dotted_name)
+
+class Package(PackageOrModule):
+ def traverse(self, name):
+ sub_module = self._module_info.getSubModuleInfo(name)
+ if sub_module is None:
+ return None
+ if sub_module.isPackage():
+ return Package(sub_module.dotted_name)
+ return Module(sub_module.dotted_name)
-class ModuleInfoView(ObjectInfoView):
- grok.context(IModuleInfo)
- grok.name('index.html')
+class Module(PackageOrModule):
+ def traverse(self, name):
+ module = self._module_info.getModule()
+ obj = getattr(module, name, None)
+ if obj is None:
+ return None
+ sub_dotted_name = self.dotted_name + '.' + name
+ if isclass(obj):
+ return Class(sub_dotted_name)
+ elif type(obj) is types.FunctionType:
+ return Function(sub_dotted_name)
+ else:
+ return Instance(sub_dotted_name)
-class PackageInfoView(ObjectInfoView):
- grok.context(IPackageInfo)
- grok.name('index.html')
- def update(self, *args, **kw):
- super(PackageInfoView, self).update(*args, **kw)
- self.files = self.getPackageFiles()
+class Class(Code):
+ pass
- def getPackageFiles(self, filter=None):
- files = self.context.getPackageFiles(filter=filter)
- result = []
- for name in files:
- dotnum = name.count('.')
- url = dotted_name_url(self.context.getDottedName() + '.' + name,
- preserve_last = dotnum)
- url = url.split('.', dotnum*2)[-1]
- result.append(dict(name=name, url=url))
- return result
+class Function(Code):
+ pass
-class DottedPathTraverser(grok.Traverser):
- """Traverse object infos.
- """
- def traverse(self, path, *args, **kw):
- dotted_name = '.'.join([self.context.getDottedName(), path])
- provider = getUtility(IObjectDescriptionProvider)
- try:
- description = provider.getDescription(dotted_name=dotted_name)
- except ImportError:
- # The required dotted name does not exist
- return CodeNotFound(dotted_name)
- return description
-
-class CodeNotFound(object):
- """What we generate if a dotted name cannot be resolved.
- """
- grok.implements(IObjectInfo)
- def __init__(self, dotted_name):
- self.dotted_name = dotted_name
-
-class CodeNotFoundView(grok.View):
- """The error view, when a dotted name cannot be resolved.
- """
- grok.context(CodeNotFound)
- grok.name('index.html')
- grok.template('codenotfound')
+class Instance(Code):
+ pass
Modified: grokui.introspector/trunk/src/grokui/introspector/code.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/code.txt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/code.txt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -18,7 +18,7 @@
The code browser is linked from the general grokui overview page::
- >>> browser.open('http://localhost/++introspector++')
+ >>> browser.open('http://localhost/++inspect++/index')
The code browser assists in giving us an overview over the available
code basis. The overview page is where we can start::
@@ -36,11 +36,6 @@
>>> zope_link = browser.getLink('Browse the zope package')
>>> zope_link.click()
-
- >> print browser.contents
- <!DOCTYPE html...
- Package: <span>...zope...</span>
- ...
The general schema how to translate a dotted name into a URL path is
described in detail below, but it is rather self-explanatory.
@@ -50,15 +45,9 @@
We can browse Python packages::
- >>> base_url = 'http://localhost/++introspector++/code/'
+ >>> base_url = 'http://localhost/++inspect++/+code/'
>>> browser.open(base_url + 'grokui/introspector')
- >> print browser.contents
- <!DOCTYPE html...
- Package: <span>...grokui...introspector...</span>
- ...
-
-
Translating a dotted name into an URL path
------------------------------------------
@@ -66,33 +55,29 @@
interpretes it as a dotted name like `mypkg.somemod.someclass`. We
look for the ``grokui.introspector`` package by browsing::
- >>> base_url = 'http://localhost/++introspector++/code/'
+ >>> base_url = 'http://localhost/++inspect++/+code/'
This URL has two important parts:
-1) the `++introspector++` tells, that we want to get introspector
+1) the `++inspect++` tells, that we want to get introspector
informations of some kind.
-2) the following `code/` part of the URL tells, that we want to
- explore the code bases (and not the registries or ZODB).
+2) the following `+code/` part of the URL tells, that we want to
+ explore the code bases (and not the registries or content).
We now only add the interesting package ``grokui.introspector`` by
adding its dotted name with dots replaced by slashes::
>>> browser.open(base_url + 'grokui/introspector')
-
- >> print browser.contents
- <!DOCTYPE html...
- Package: <span>...grokui...introspector...</span>
...
So, the general schema of using the grokui code browser is to enter an
URL that starts with:
- `/++introspector++/code/`
+ `/++inspect++/+code/`
and then adding a dotted name with the dots replaced by slashes, so
that `mypkg.modname.someclass` translates to:
- `/++introspector++/code/mypkg/modname/someclass`
+ `/++inspect++/+code/mypkg/modname/someclass`
Modified: grokui.introspector/trunk/src/grokui/introspector/interfaces.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/interfaces.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/interfaces.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -15,26 +15,11 @@
"""
from zope.interface import Interface
-class IGrokIntrospector(Interface):
- """An introspector for scanning the runtime system.
- """
- def __init__(obj, request):
- """An introspector must handle requests on arbitrary objects.
- It it the base for exploring the whole introspector facilities
- provided and should deliver content based on the request.
-
- How the request data is interpreted, is up to the introspector.
- """
-
-class IGrokRegistryIntrospector(IGrokIntrospector):
+class IGrokRegistryIntrospector(Interface):
"""An introspector for registries.
"""
-class IGrokCodeIntrospector(IGrokIntrospector):
+class IGrokCodeIntrospector(Interface):
"""An introspector for packages, classes and other code.
"""
-
-class IGrokContentBrowser(IGrokIntrospector):
- """A content browser
- """
Modified: grokui.introspector/trunk/src/grokui/introspector/introspector.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/introspector.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/introspector.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -15,38 +15,22 @@
"""
import grok
from zope.component import getUtility
-from zope.introspector.interfaces import (IRegistryInfo,
- IObjectDescriptionProvider,)
-from zope.location.interfaces import ILocation
-from zope.traversing.interfaces import ITraversable
-from grok.interfaces import IContext
-from grokui.introspector.interfaces import (IGrokIntrospector,
- IGrokRegistryIntrospector,
- IGrokCodeIntrospector,
- IGrokContentBrowser)
+from zope.introspector.interfaces import IRegistryInfo
+from grokui.introspector.interfaces import (IGrokRegistryIntrospector,
+ IGrokCodeIntrospector)
+from zope.app.folder.interfaces import IRootFolder
+from grokui.introspector.code import Package
-class Introspector(object):
- grok.implements(IGrokIntrospector, ILocation, IContext)
+class RootTraverser(grok.Traverser):
+ grok.context(IRootFolder)
- def __init__(self, parent, name):
- self.__parent__ = parent
- self.__name__ = name
-
-def get_introspector():
- return Introspector
-grok.global_utility(get_introspector, provides=IGrokIntrospector)
-
-class IntrospectorTraverser(grok.Traverser):
- grok.context(IGrokIntrospector)
- def traverse(self, path, *args, **kw):
- if path == 'registries':
- return RegistryIntrospector()
- if path == 'code':
+ def traverse(self, name):
+ if name == '+code':
return CodeIntrospector()
- if path == 'content':
- return ContentBrowser()
- return self.context
-
+ elif name == '+registry':
+ return RegistryIntrospector()
+ return None
+
class RegistryIntrospector(grok.Model):
grok.implements(IGrokRegistryIntrospector)
@@ -60,31 +44,13 @@
) for x in uinfo.getAllUtilities()]
return utilities
-
class CodeIntrospector(grok.Model):
grok.implements(IGrokCodeIntrospector)
-
- def __init__(self, dotted_name=None, *args, **kw):
- super(CodeIntrospector, self).__init__(*args, **kw)
- self.dotted_name = dotted_name
- def getIntrospector(self):
- if self.dotted_name is None:
- return self
- provider = getUtility(IObjectDescriptionProvider)
- description = provider.getDescription(dotted_name=self.dotted_name)
- return description
-
-class CodeTraverser(grok.Traverser):
- grok.context(IGrokCodeIntrospector)
-
- def traverse(self, path, *args, **kw):
- dotted_name = self.context.dotted_name or ''
- if len(dotted_name):
- dotted_name += '.'
- dotted_name += path
- introspector = CodeIntrospector(dotted_name=dotted_name)
- return introspector.getIntrospector()
-
-class ContentBrowser(grok.Model):
- grok.implements(IGrokContentBrowser)
+ def traverse(self, name):
+ if '.' in name:
+ return None
+ try:
+ return Package(name)
+ except ImportError:
+ return None
Added: grokui.introspector/trunk/src/grokui/introspector/namespace.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/namespace.py (rev 0)
+++ grokui.introspector/trunk/src/grokui/introspector/namespace.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -0,0 +1,33 @@
+import grok
+
+from zope.interface import Interface
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.traversing.interfaces import ITraversable
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.browser import applySkin
+from zope.location.location import locate
+
+class IntrospectorLayer(IDefaultBrowserLayer):
+ """A basic layer for all introspection stuff.
+ """
+ pass
+
+class IntrospectorSkin(grok.Skin):
+ """A skin for all introspection stuff.
+ """
+ grok.layer(IntrospectorLayer)
+
+
+class GrokIntrospectorNamespace(grok.MultiAdapter):
+ grok.name('inspect')
+ grok.provides(ITraversable)
+ grok.adapts(Interface, IBrowserRequest)
+ grok.layer(IntrospectorSkin)
+
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def traverse(self, name, ignore):
+ applySkin(self.request, IntrospectorLayer)
+ return self.context
Modified: grokui.introspector/trunk/src/grokui/introspector/util.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/util.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/util.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -13,7 +13,6 @@
##############################################################################
"""Helpers for the grokui.introspector.
"""
-from grokui.introspector import NAMESPACE
def dotted_name_url(dotted_path, preserve_last=0):
"""Create an HTML fragment with links to parts of a dotted name.
@@ -22,8 +21,8 @@
parts = dotted_path.split('.', len(dotted_path.split('.'))
- 1 - preserve_last)
for i in range(0, len(parts)):
- part = '<a href="/++%s++/code/%s">%s</a>' % (
- NAMESPACE, '/'.join(parts[0:i+1]), parts[i])
+ part = '<a href="/++inspect++/+code/%s">%s</a>' % (
+ '/'.join(parts[0:i+1]), parts[i])
result.append(part)
return '.'.join(result)
-
+
Modified: grokui.introspector/trunk/src/grokui/introspector/util.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/util.txt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/util.txt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -16,24 +16,24 @@
>>> from grokui.introspector.util import dotted_name_url
>>> dotted_name_url('zope')
- u'<a href="/++introspector++/code/zope">zope</a>'
+ '<a href="/++inspect++/+code/zope">zope</a>'
The HTML for the ``zope.introspector`` package is the same but a link
to the ``introspector subpackage appended::
>>> dotted_name_url('zope.introspector')
- u'...<a href="/++introspector++/code/zope/introspector">introspector</a>'
+ '...<a href="/++inspect++/+code/zope/introspector">introspector</a>'
If we want a part of the dotted path to persist, for instance, because
it is not an individual part of the dotted name but a file extension,
we can do so by providing the `preserve_last` option::
>>> dotted_name_url('zope.README.txt', preserve_last=1)
- u'...<a href="/++introspector++/code/zope/README.txt">README.txt</a>'
+ '...<a href="/++inspect++/+code/zope/README.txt">README.txt</a>'
The default value for `preserve_last` is zero, which means that every
dot in the dotted name means a new component. Larger values handle
also components with more than one dot in their name::
>>> dotted_name_url('zope.README.txt.gz', preserve_last=2)
- u'...<a href="/++introspector++/code/zope/README.txt.gz">README.txt.gz</a>'
+ '...<a href="/++inspect++/+code/zope/README.txt.gz">README.txt.gz</a>'
Modified: grokui.introspector/trunk/src/grokui/introspector/views.py
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views.py 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views.py 2008-07-22 13:46:50 UTC (rev 88687)
@@ -16,88 +16,28 @@
"""
import grok
-from zope.component import getUtility
from zope.interface import Interface
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-from zope.traversing.interfaces import ITraversable
-from grokui.introspector.interfaces import (IGrokIntrospector,
- IGrokRegistryIntrospector,
- IGrokCodeIntrospector,
- IGrokContentBrowser)
+from zope.app.folder.interfaces import IRootFolder
-NAMESPACE = u'introspector'
+from grokui.introspector.interfaces import (IGrokRegistryIntrospector,
+ IGrokCodeIntrospector)
+from grokui.introspector.namespace import IntrospectorLayer
-grok.context(IGrokIntrospector)
+grok.layer(IntrospectorLayer)
-class IntrospectorLayer(IDefaultBrowserLayer):
- """A basic layer for all introspection stuff.
- """
- pass
-
-class IntrospectorSkin(grok.Skin):
- """A skin for all introspection stuff.
- """
- grok.layer(IntrospectorLayer)
-
-class Master(grok.View):
- """The Macro page that defines the default look and feel.
- """
-
class Index(grok.View):
"""The overview page.
"""
- pass
+ grok.context(IRootFolder)
-class RegistryOverview(grok.View):
+class Registry(grok.View):
grok.name('index')
- grok.template('registries')
grok.context(IGrokRegistryIntrospector)
def getUtilities(self):
utils = self.context.getUtilities()
return utils
-class CodeOverview(grok.View):
+class Code(grok.View):
grok.name('index')
- grok.template('code')
grok.context(IGrokCodeIntrospector)
-
-class ContentOverview(grok.View):
- grok.name('index')
- grok.template('content')
- grok.context(IGrokContentBrowser)
-
-# The viewlet managers...
-
-class HeaderManager(grok.ViewletManager):
- """This viewlet manager cares for things inside the HTML header.
- """
- grok.name('header')
-
-class PageTopManager(grok.ViewletManager):
- """This viewlet manager cares for the upper page.
- """
- grok.name('top')
-
-class PageContentManager(grok.ViewletManager):
- """This viewlet manager cares for the main content section of a page.
- """
- grok.name('main')
-
-class PageFooterManager(grok.ViewletManager):
- """This viewlet manager cares for the page footer.
- """
- grok.name('footer')
-
-class GrokIntrospectorNamespace(grok.MultiAdapter):
- grok.name(NAMESPACE)
- grok.provides(ITraversable)
- grok.adapts(Interface, Interface)
- grok.layer(IntrospectorSkin)
-
- def __init__(self, ob, req=None):
- self.context = ob
-
- def traverse(self, name, ignore):
- introspector = getUtility(IGrokIntrospector)
- return introspector(self.context, NAMESPACE + name)
Modified: grokui.introspector/trunk/src/grokui/introspector/views_templates/code.pt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/code.pt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/code.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -1,7 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html metal:use-macro="context/@@master/macros/page">
- <div metal:fill-slot="main">
+<html>
+ <body>
+ <div>
<h1>Code</h1>
<h2>Code</h2>
@@ -21,4 +22,5 @@
</div>
</div>
+ </body>
</html>
Deleted: grokui.introspector/trunk/src/grokui/introspector/views_templates/content.pt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/content.pt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/content.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html metal:use-macro="context/@@master/macros/page">
- <div metal:fill-slot="main">
- <h1>Content browser</h1>
-
- <h2>Content</h2>
-
-
- </div>
-</html>
Modified: grokui.introspector/trunk/src/grokui/introspector/views_templates/index.pt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/index.pt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/index.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -1,13 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html metal:use-macro="context/@@master/macros/page">
- <div metal:fill-slot="main">
+<html>
+ <body>
+ <div>
<h1>The Grok Introspector</h1>
<h2>Registries</h2>
<div class="docgrok-annotation1">
- <a tal:attributes="href string:registries">
+ <a tal:attributes="href string:+registry/@@index">
Browse the registries (utilitites, adapters, etc.)
</a>
</div>
@@ -15,13 +16,13 @@
<h2>Code</h2>
<div class="docgrok-annotation1">
- <a tal:attributes="href string:code">
+ <a tal:attributes="href string:+code/@@index">
Browse classes, packages and other filesystem based information
</a>
</div>
<h2>Content</h2>
-
+
<div class="docgrok-annotation1">
<a tal:attributes="href string:content">
Browse the content
@@ -29,4 +30,5 @@
</div>
</div>
+ </body>
</html>
Deleted: grokui.introspector/trunk/src/grokui/introspector/views_templates/master.pt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/master.pt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/master.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
- lang="en"
- metal:define-macro="page">
- <head>
- <meta http-equiv="Content-Type"
- content="text/html;;charset=utf-8" />
-
- <link rel="stylesheet" type="text/css"
- tal:attributes="href static/grok.css" />
-
- </head>
- <body>
-
- <div id="banner">
- <a href="/" id="logo"
- tal:attributes="href python:view.url(context)">
- <img alt="Grok" height="40"
- tal:attributes="src static/grok-admin.jpg" />
- </a>
- </div>
-
- <div id="logout">
- <span i18n:translate="">User:
- <span tal:replace="request/principal/title"
- i18n:name="user_title">User</span>
- </span>
- </div>
-
- <div id="breadcrumbs">
- <div id="banner-shadow">
-
- </div>
- </div>
-
- <div id="top">
- <tal:header content="structure provider:top" />
- </div>
-
- <div class="docgrok-annotation1">
- <div id="main"
- metal:define-slot="main">
- </div>
- </div>
- </body>
-</html>
Deleted: grokui.introspector/trunk/src/grokui/introspector/views_templates/registries.pt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/registries.pt 2008-07-22 13:37:03 UTC (rev 88686)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/registries.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -1,32 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html metal:use-macro="context/@@master/macros/page">
- <div metal:fill-slot="main">
- <h1>Registries</h1>
-
- <h2>Utilities</h2>
-
- <div>
- The following utilities are currently registered:
- <div tal:repeat="util python:view.getUtilities()">
- <!-- div tal:content="util" / -->
- <div>
- Component: <span tal:content="python:util['component']" />
- </div>
- <div>
- Name: <span tal:content="python:util['name']" />
- </div>
- <div>
- Provided: <span tal:content="python:util['provided']" />
- </div>
- <div>
- Registry: <span tal:content="python:util['registry']" />
- </div>
- <div> </div>
-
- </div>
- </div>
-
-
- </div>
-</html>
Copied: grokui.introspector/trunk/src/grokui/introspector/views_templates/registry.pt (from rev 88678, grokui.introspector/trunk/src/grokui/introspector/views_templates/registries.pt)
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/views_templates/registry.pt (rev 0)
+++ grokui.introspector/trunk/src/grokui/introspector/views_templates/registry.pt 2008-07-22 13:46:50 UTC (rev 88687)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <body>
+ <div>
+ <h1>Registries</h1>
+
+ <h2>Utilities</h2>
+
+ <div>
+ The following utilities are currently registered:
+ <div tal:repeat="util python:view.getUtilities()">
+ <!-- div tal:content="util" / -->
+ <div>
+ Component: <span tal:content="python:util['component']" />
+ </div>
+ <div>
+ Name: <span tal:content="python:util['name']" />
+ </div>
+ <div>
+ Provided: <span tal:content="python:util['provided']" />
+ </div>
+ <div>
+ Registry: <span tal:content="python:util['registry']" />
+ </div>
+ <div> </div>
+
+ </div>
+ </div>
+
+
+ </div>
+ </body>
+</html>
More information about the Checkins
mailing list