[Zope-Checkins] CVS: Zope2 - HelpContext.py:1.1.2.3 ProductHelp.py:1.1.2.4 Util.py:1.1.2.3

Michel Pelletier michel@digicool.com
Thu, 17 May 2001 20:43:17 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/HelpSys
In directory korak.digicool.com:/tmp/cvs-serv17403/lib/python/HelpSys

Modified Files:
      Tag: APIDocs-branch
	HelpContext.py ProductHelp.py Util.py 
Log Message:
support for deep documenation


--- Updated File HelpContext.py in package Zope2 --
--- HelpContext.py	2001/05/17 18:06:45	1.1.2.2
+++ HelpContext.py	2001/05/18 00:43:16	1.1.2.3
@@ -4,6 +4,8 @@
 _registry['ZODB/help'] = 1 # ZODB is too low level
                            # to register itself.
 
+_registry['Pydocs'] = 1
+
 class HelpContext:
 
     """ Core packages must register themsevles at import time, but

--- Updated File ProductHelp.py in package Zope2 --
--- ProductHelp.py	2001/05/17 19:02:19	1.1.2.3
+++ ProductHelp.py	2001/05/18 00:43:16	1.1.2.4
@@ -81,28 +81,32 @@
         ('View Help', ('index_html', '')),
         )
     
-    def __init__(self, id='Help', title=''):
+    def __init__(self, id='Help', title='', cat=None):
         self.id=id
         self.title=title
-        self.catalog=ZCatalog('catalog')
-        c=self.catalog._catalog
-        # clear catalog
-        for index in c.indexes.keys():
-            c.delIndex(index)
-        for col in c.schema.keys():
-            c.delColumn(col)
-        c.addIndex('SearchableText', 'TextIndex')
-        c.addIndex('categories', 'KeywordIndex') # we'll keep this here for now
+        if cat is None:
+            self.catalog=ZCatalog('catalog')
+            c=self.catalog._catalog
+            # clear catalog
+            for index in c.indexes.keys():
+                c.delIndex(index)
+            for col in c.schema.keys():
+                c.delColumn(col)
+            c.addIndex('id', 'FieldIndex')
+            c.addIndex('SearchableText', 'TextIndex')
+            c.addIndex('categories', 'KeywordIndex') # we'll keep this here for now
 
-##         c.indexes['categories'] = KWHierarchy('keywords', 'Keyword Hierarchy',
-##                                                      c.data, c.schema.keys(), [])
-        
-        c.addIndex('permissions', 'KeywordIndex')
-        c.addColumn('categories')
-        c.addColumn('permissions')
-        c.addColumn('title_or_id')
-        c.addColumn('url')
-        c.addColumn('id')
+    ##         c.indexes['categories'] = KWHierarchy('keywords', 'Keyword Hierarchy',
+    ##                                                      c.data, c.schema.keys(), [])
+
+            c.addIndex('permissions', 'KeywordIndex')
+            c.addColumn('categories')
+            c.addColumn('permissions')
+            c.addColumn('title_or_id')
+            c.addColumn('url')
+            c.addColumn('id')
+        else:
+            self.catalog=cat
 
     index_html=DTMLFile('dtml/index_html', globals())
 

--- Updated File Util.py in package Zope2 --
--- Util.py	2001/05/17 18:51:04	1.1.2.2
+++ Util.py	2001/05/18 00:43:16	1.1.2.3
@@ -1,4 +1,5 @@
 
+from ProductHelp import ProductHelp
 import HelpTopic, APIHelpTopic
 import Globals
 import re, os, string
@@ -52,6 +53,11 @@
     into help topics. """
 
     for file in os.listdir(path):
+        if os.path.isdir(file):
+            ph = ProductHelp(file, 'Help for %s' % file, cat=product_help.catalog)
+            product_help.addTopic(ph)
+            lazySetup(os.path.join(path, file), ph, categories)
+            
         ext=os.path.splitext(file)[1]
         ext=string.lower(ext)
         if ext in ('.dtml',):