[Checkins] SVN: grokui.introspector/trunk/src/grokui/introspector/
Move code browser documentation to an own file.
Uli Fouquet
uli at gnufix.de
Sat Jul 19 07:09:00 EDT 2008
Log message for revision 88583:
Move code browser documentation to an own file.
Changed:
U grokui.introspector/trunk/src/grokui/introspector/README.txt
A grokui.introspector/trunk/src/grokui/introspector/code.txt
-=-
Modified: grokui.introspector/trunk/src/grokui/introspector/README.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/README.txt 2008-07-19 11:01:54 UTC (rev 88582)
+++ grokui.introspector/trunk/src/grokui/introspector/README.txt 2008-07-19 11:08:59 UTC (rev 88583)
@@ -105,32 +105,11 @@
>>> zope_link
<Link ... url='http://localhost/++introspector++/code/zope'>
-We look for the ``grokui.introspector`` package by browsing::
+This link is translated by the system to the dotted name `zope`, which
+means to display the object, whose dotted name is 'zope'.
- >>> base_url = 'http://localhost/++introspector++/code/'
+See `code.txt` to learn more about the code browser.
-This URL has two important parts:
-
-1) the `++introspector++` 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).
-
-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>
- ...
-
-We get back to introspector home page::
-
- >>> browser.open('http://localhost/++introspector++/')
-
-
Browsing the ZODB
=================
Added: grokui.introspector/trunk/src/grokui/introspector/code.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/code.txt (rev 0)
+++ grokui.introspector/trunk/src/grokui/introspector/code.txt 2008-07-19 11:08:59 UTC (rev 88583)
@@ -0,0 +1,95 @@
+grokui.introspector.code
+************************
+
+Browsing the code base (Python packages, modules and more).
+
+:Test-Layer: functional
+
+Browsing code (classes, packages, etc.)
+=======================================
+
+Before we can access any pages, we have to initialize the test
+browser::
+
+ >>> from zope.testbrowser.testing import Browser
+ >>> browser = Browser()
+ >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> browser.handleErrors = False
+
+The code browser is linked from the general grokui overview page::
+
+ >>> browser.open('http://localhost/++introspector++')
+
+The code browser assists in giving us an overview over the available
+code basis. The overview page is where we can start::
+
+ >>> browser.getLink(
+ ... "Browse classes, packages and other filesystem based information"
+ ... ).click()
+ >>> print browser.contents
+ <!DOCTYPE html...
+ <h1>Code</h1>
+ ...
+
+The overview page provides already some starting points to explore the
+whole code basis. We can go to the ``zope`` package::
+
+ >>> 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.
+
+Browsing Python packages
+------------------------
+
+We can browse Python packages::
+
+ >>> base_url = 'http://localhost/++introspector++/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
+------------------------------------------
+
+The system detects from the URL what thing we want to examine. It
+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/'
+
+This URL has two important parts:
+
+1) the `++introspector++` 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).
+
+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/`
+
+and then adding a dotted name with the dots replaced by slashes, so
+that `mypkg.modname.someclass` translates to:
+
+ `/++introspector++/code/mypkg/modname/someclass`
+
More information about the Checkins
mailing list