commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5354 - in trunk: gnue-common/utils/helpers www www/docs www/utils/webhe


From: jcater
Subject: r5354 - in trunk: gnue-common/utils/helpers www www/docs www/utils/webhelpers www/web/shared
Date: Thu, 18 Mar 2004 18:57:06 -0600 (CST)

Author: jcater
Date: 2004-03-18 18:57:05 -0600 (Thu, 18 Mar 2004)
New Revision: 5354

Modified:
   trunk/gnue-common/utils/helpers/tools.py
   trunk/www/README
   trunk/www/docs/common.txt
   trunk/www/docs/forms.txt
   trunk/www/utils/webhelpers/tools.py
   trunk/www/web/shared/base.css
Log:
Show docs on tool page


Modified: trunk/gnue-common/utils/helpers/tools.py
===================================================================
--- trunk/gnue-common/utils/helpers/tools.py    2004-03-19 00:01:36 UTC (rev 
5353)
+++ trunk/gnue-common/utils/helpers/tools.py    2004-03-19 00:57:05 UTC (rev 
5354)
@@ -1,4 +1,4 @@
-import sys, os, string, time
+import sys, os, string, time, glob
 from files import openModuleFile, importModule, SubheadedFile, SVN_BASE, 
htmlify
 from StringIO import StringIO
 
@@ -246,6 +246,7 @@
 class DOCS:
   def __init__(self, tool):
 
+    self.tool = tool
     try:
       file = open(os.path.join(SVN_BASE,'www','docs','%s.txt'%tool))
       lines = file.readlines()
@@ -271,7 +272,7 @@
                   'audience': None,
                   'location': None,
                   'autoextensions': 'No' }
-        current = (text, props)
+        current = (props, text)
         self.allfiles.append(current)
       elif not line.strip() and in_header:
         in_header = False
@@ -279,7 +280,7 @@
         try:
           field, value = line.split(':',1)
           props[field.lower()] = value.strip()
-          if field.lower() == 'Audience':
+          if field.lower() == 'audience':
             for audience in value.strip().replace(' ','').split(','):
               if audience.lower() == 'enduser':
                 self.userfiles.append(current)
@@ -288,7 +289,7 @@
               elif audience.lower() == 'coredeveloper':
                 self.corefiles.append(current)
               else:
-                print "WARNING: gnue-%s www/docs/%s.txt has invalid target: 
%s" % (tool, tool, value)
+                print "WARNING: gnue-%s www/docs/%s.txt has invalid audience: 
%s" % (tool, tool, value)
         except ValueError:
           print "WARNING: gnue-%s www/docs/%s.txt has invalid header line:" % 
(tool, tool)
           print "   ", line
@@ -300,28 +301,43 @@
     """
     Returns a list of tuples in format of [ ('/path/to/1','Format'), .. ]
     """
-    if props['autoextensions'].lower()[:1] == 'Y':
+    if props['autoextensions'].lower()[:1] == 'y':
       files = []
       if dest[-1] == '/':
         dest = dest[:-1]
-        files = []
-        for file in glob.glob(os.path.join(dest, props['location'] + '.*')):
-          files.append(file[len(dest):])
+      print dest+props['location'] + '.*'
+      for file in glob.glob(dest+props['location'] + '.*'):
+        files.append(file[len(dest):])
+      if not files:
+        print "WARNING: gnue-%s refers to doc %s.*, but not found: assuming 
html" % (self.tool, props['location'])
+        files.append(props['location']+'.html')
     else:
       files = [props['location']]
 
     results = []
     for file in files:
       base = file.split('/')[-1]
+
+      # Some assumptions:
+      #   .php    --> HTML
+      #   .(html|ps|pdf|txt|sxw|..)  --> Native type
+      #   .tar.gz             --> Compressed HTML files
+      #   .(html|ps|txt).gz   --> Compressed version of doc format
+      #   .gz                 --> Compressed HTML Files
+      #   *                   --> HTML (pointer to directory)
+
       if '.' in base:
         ext = base.split('.')[-1].upper()
         compressed = 0
-        if ext == 'GZ':
+        if ext in ('TGZ','GZ'):
+          compressed = 1
           stuff = base.split('.')
           if len(stuff) > 2:
-            ext = stuff[-2]
+            ext = stuff[-2].upper()
+            if ext == 'TAR':
+              ext = 'HTML'
           else:
-            ext = 'Plain Text'
+            ext = 'HTML'
         if ext == 'TXT':
           ext = 'Plain Text'
         elif ext == 'PHP':
@@ -332,11 +348,12 @@
           ext = 'Postscript'
         if compressed:
           ext += ' (Compressed)'
-        results.append(file)
+        results.append((file, ext))
       else:
         # No extension, assume it's HTML
         results.append((file, 'HTML'))
 
+    return results
 
 #################################################
 #

Modified: trunk/www/README
===================================================================
--- trunk/www/README    2004-03-19 00:01:36 UTC (rev 5353)
+++ trunk/www/README    2004-03-19 00:57:05 UTC (rev 5354)
@@ -99,7 +99,8 @@
 
 The following "docs" are added automatically:
    - FAQ
-   - Roadmap/Feature Plans
+   - Roadmap
+   - Technotes
 
 General project docs are indicated in Project.txt. Docs that don't pertain to 
any
 specific tool, but to the project as a whole, should go here.

Modified: trunk/www/docs/common.txt
===================================================================
--- trunk/www/docs/common.txt   2004-03-19 00:01:36 UTC (rev 5353)
+++ trunk/www/docs/common.txt   2004-03-19 00:57:05 UTC (rev 5354)
@@ -11,7 +11,7 @@
 API reference, would be the one to use.
 
 [API Reference]
-Name: Developer's Guide
+Name: API Reference
 Audience: End Developer, Core Developer
 Location: /tools/common/docs/api
 AutoExtensions: No

Modified: trunk/www/docs/forms.txt
===================================================================
--- trunk/www/docs/forms.txt    2004-03-19 00:01:36 UTC (rev 5353)
+++ trunk/www/docs/forms.txt    2004-03-19 00:57:05 UTC (rev 5354)
@@ -10,7 +10,7 @@
 is also provided.
 
 [API Reference]
-Name: Developer's Guide
+Name: Core API Reference
 Audience: Core Developer
 Location: /tools/forms/docs/api
 AutoExtensions: No

Modified: trunk/www/utils/webhelpers/tools.py
===================================================================
--- trunk/www/utils/webhelpers/tools.py 2004-03-19 00:01:36 UTC (rev 5353)
+++ trunk/www/utils/webhelpers/tools.py 2004-03-19 00:57:05 UTC (rev 5354)
@@ -17,6 +17,7 @@
 def run():
 
   DEST = dest()
+  print "DEST=%s" % DEST
 
   # Create the _module_menu.php for the tools/ section
   #
@@ -139,9 +140,23 @@
     ##
     ## Documentation
     ##
-    html += '<h2>Documentation</h2>\n'   #TODO
-    html += '<ul><li><a href="docs/faq.php">Frequently Asked 
Questions</a></li></ul>\n'
+    html += '<h2>Documentation</h2>\n<ul>'   #TODO
+    html += '<li>Frequently Asked Questions: <a 
href="docs/faq.php">HTML</a></li>\n'
 
+    for fileset, descr in (
+                (mod.docs.userfiles, 'User'),
+                (mod.docs.devfiles,'Designer/Developer') ):
+      if fileset:
+        html += '<li>%s Documentation:</p><ul>\n' % descr
+        for props, text in fileset:
+          all = []
+          for file, type in mod.docs.getTypes(props, DEST):
+            all.append('<a href="%s">%s</a>' % (file, type))
+          html += '  <li>%s: %s</li>\n' % (props['name'], string.join(all,' | 
'))
+        html += '</ul></li>\n'
+
+    html += '</ul>'
+
     ##
     ## Release History
     ##

Modified: trunk/www/web/shared/base.css
===================================================================
--- trunk/www/web/shared/base.css       2004-03-19 00:01:36 UTC (rev 5353)
+++ trunk/www/web/shared/base.css       2004-03-19 00:57:05 UTC (rev 5354)
@@ -157,6 +157,11 @@
   padding-left: 20pt;
 }
 
+/*ul,ol li ul,ol{
+  margin: 0px 0 0 0;
+  padding-left: 40pt;
+}*/
+
 li {
   margin-left: 0;
   padding: 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]