WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Pass the root directory to Doxyfilter and thence pythfil

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Pass the root directory to Doxyfilter and thence pythfilter.py so that the latter can get the namespace/packages correct.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Sep 2005 15:16:13 +0000
Delivery-date: Tue, 13 Sep 2005 15:15:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User ewan@xxxxxxxxxxxxx
# Node ID e939d5c5e646fe27e4c94563dc90a7f89a144556
# Parent  bcbd2d2c10680b16fd9597f2759773dc2cb29cdb
Pass the root directory to Doxyfilter and thence pythfilter.py so that the 
latter can get the namespace/packages correct.

diff -r bcbd2d2c1068 -r e939d5c5e646 docs/Doxyfile
--- a/docs/Doxyfile     Tue Sep 13 13:41:05 2005
+++ b/docs/Doxyfile     Tue Sep 13 13:42:21 2005
@@ -519,7 +519,7 @@
 # to standard output.  If FILTER_PATTERNS is specified, this tag will be 
 # ignored.
 
-INPUT_FILTER           = "sh ./Doxyfilter"
+INPUT_FILTER           = "sh ./Doxyfilter ../tools/python"
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
 # basis.  Doxygen will compare the file name with each pattern and apply the 
diff -r bcbd2d2c1068 -r e939d5c5e646 docs/pythfilter.py
--- a/docs/pythfilter.py        Tue Sep 13 13:41:05 2005
+++ b/docs/pythfilter.py        Tue Sep 13 13:42:21 2005
@@ -469,12 +469,25 @@
         sys.stdout.write(s)
 
 def filter(filename):
-    global name, module_has_docstring
+    global name, module_has_docstring, source_root
 
     path,name = os.path.split(filename)
     root,ext  = os.path.splitext(name)
 
-    output("namespace "+root+" {\n",(0,0))
+    if source_root and path.find(source_root) == 0:
+        path = path[len(source_root):]
+
+        if path[0] == os.sep:
+            path = path[1:]
+
+        ns = path.split(os.sep)
+    else:
+        ns = []
+
+    ns.append(root)
+
+    for n in ns:
+        output("namespace " + n + " {\n",(0,0))
 
     # set module name for tok_eater to use if there's a module doc string
     name = root
@@ -486,7 +499,9 @@
     print_comment((0,0))
 
     output("\n",(0,0))
-    output("}  // end of namespace\n",(0,0))
+    
+    for n in ns:
+        output("}  // end of namespace\n",(0,0))
 
     if not module_has_docstring:
         # Put in default namespace documentation
@@ -611,9 +626,10 @@
 ######################################################################
 
 filter_file = False
+source_root = None
 
 try:
-    opts, args = getopt.getopt(sys.argv[1:], "hf", ["help"])
+    opts, args = getopt.getopt(sys.argv[1:], "hfr:", ["help"])
 except getopt.GetoptError,e:
     print e
     sys.exit(1)
@@ -622,10 +638,13 @@
     if o=="-f":
         filter_file = True
 
+    if o=="-r":
+        source_root = os.path.abspath(a)
+
 if filter_file:
     # Filter the specified file and print the result to stdout
     filename = string.join(args)
-    filterFile(filename)
+    filterFile(os.path.abspath(filename))
 else:
 
     if len(args)!=2:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>