diff document_it.py @ 15:d9026d114655

deal with eccentricities of local directories
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 02 Aug 2011 16:46:40 -0700
parents 145a11393a73
children d6528dd74592
line wrap: on
line diff
--- a/document_it.py	Tue Aug 02 16:40:10 2011 -0700
+++ b/document_it.py	Tue Aug 02 16:46:40 2011 -0700
@@ -95,7 +95,7 @@
     parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
     parser.add_option('-d', '--directory', dest='directory',
                       help='render the documentation from this directory')
-    parser.add_option('--dest', dest='dest',
+    parser.add_option('-o', '--dest', dest='dest',
                       default=default_dir,
                       help='base directory or URL of destination [DEFAULT: %default]')
     parser.add_option('-u', '--user', dest='user',
@@ -117,7 +117,7 @@
     if '://' in options.dest:
         baseurl = options.dest
     else:
-        baseurl = 'file://' + options.dest
+        baseurl = 'file://' + os.path.abspath(options.dest)
 
     # read the manifests
     files = []
@@ -142,7 +142,9 @@
 
         # TODO render to directory
         for src, dest in files:
-            dest = os.path.join(options.dest, dest)
+            
+            if dest.startswith('file://'):
+                dest = dest[len('file://'):]
 
             # create a directory if needed
             dirname = os.path.dirname(dest)