[Zope-Checkins] CVS: Zope2 - APIHelpTopic.py:1.10.32.2 HelpTopic.py:1.13.6.2 Util.py:1.1.2.2

Michel Pelletier michel@digicool.com
Thu, 17 May 2001 14:51:05 -0400 (EDT)


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

Modified Files:
      Tag: APIDocs-branch
	APIHelpTopic.py HelpTopic.py Util.py 
Log Message:
fixed category bug


--- Updated File APIHelpTopic.py in package Zope2 --
--- APIHelpTopic.py	2001/05/17 15:59:42	1.10.32.1
+++ APIHelpTopic.py	2001/05/17 18:51:04	1.10.32.2
@@ -114,7 +114,8 @@
         dict={}
         execfile(file, dict)
         self.doc=dict.get('__doc__','')
-        self.categories = categories
+        if categories is not None:
+            self.categories = categories
 
         self.apis=[]
         for k, v in dict.items():

--- Updated File HelpTopic.py in package Zope2 --
--- HelpTopic.py	2001/05/17 15:59:42	1.13.6.1
+++ HelpTopic.py	2001/05/17 18:51:04	1.13.6.2
@@ -183,7 +183,8 @@
         return self.catalog
 
 
-class HelpTopic(Acquisition.Implicit, HelpTopicBase, Item, PropertyManager, Persistent):
+class HelpTopic(Acquisition.Implicit, HelpTopicBase,
+                Item, PropertyManager, Persistent):
     """
     Abstract base class for Help Topics
     """
@@ -191,6 +192,8 @@
     meta_type='Help Topic'
     icon='p_/HelpTopic_icon'
     _v_last_read = 0
+
+    categories = ()
 
     manage_options=(
         {'label':'Properties', 'action':'manage_propertiesForm'},

--- Updated File Util.py in package Zope2 --
--- Util.py	2001/05/17 15:59:42	1.1.2.1
+++ Util.py	2001/05/17 18:51:04	1.1.2.2
@@ -31,7 +31,8 @@
                                permissions=permissions, categories=categories)
         context.registerHelpTopic(file, ht)
     elif ext in ('.stx', '.txt'):
-        title=string.split(open(os.path.join(path,file),'rb').readline(), ':')[0]
+        title=string.split(open(os.path.join(path,file),
+                                'rb').readline(), ':')[0]
         ht=HelpTopic.STXTopic(file, title, os.path.join(path, file),
                               permissions=permissions, categories=categories)
         context.registerHelpTopic(file, ht)
@@ -41,7 +42,8 @@
         context.registerHelpTopic(file, ht)
     elif ext in ('.py',):
         ht=APIHelpTopic.APIHelpTopic(file, '', os.path.join(path, file),
-                                     permissions=permissions, categories=categories)
+                                     permissions=permissions,
+                                     categories=categories)
         context.registerHelpTopic(file, ht)
 
 
@@ -59,7 +61,8 @@
                 title = m.group(1)
             else:
                 title = ''
-            ht=HelpTopic.DTMLTopic(file, '', os.path.join(path,file), categories=categories)
+            ht=HelpTopic.DTMLTopic(file, '', os.path.join(path,file),
+                                   categories=categories)
             product_help.addTopic(ht)
         elif ext in ('.html', '.htm'):
             contents = open(os.path.join(path,file),'rb').read()
@@ -68,17 +71,20 @@
                 title = m.group(1)
             else:
                 title = ''
-            ht=HelpTopic.TextTopic(file, title, os.path.join(path,file), categories=categories)
+            ht=HelpTopic.TextTopic(file, title, os.path.join(path,file),
+                                   categories=categories)
             product_help.addTopic(ht)
         elif ext in ('.stx', '.txt'):
-            title=string.split(open(os.path.join(path,file),'rb').readline(), ':')[0]
-            categories = None
+            title=string.split(open(os.path.join(path,file),'rb').readline(),
+                               ':')[0]
             if file[:5]=='dtml-':
-                categories = ('DTML',)
-            ht=HelpTopic.STXTopic(file, title, os.path.join(path, file), categories=categories)
+                categories = categories + ('DTML',)
+            ht=HelpTopic.STXTopic(file, title, os.path.join(path, file),
+                                  categories=categories)
             product_help.addTopic(ht)
         elif ext in ('.jpg', '.gif', '.png'):
-            ht=HelpTopic.ImageTopic(file, '', os.path.join(path, file), categories=categories)
+            ht=HelpTopic.ImageTopic(file, '', os.path.join(path, file),
+                                    categories=categories)
             product_help.addTopic(ht)
         elif ext in ('.py',) and not file=='__init__.py':
             ht=APIHelpTopic.APIHelpTopic(file, '', os.path.join(path, file),