Doug Hellmann avatar Doug Hellmann committed efba344 Merge

merge in bug fix for #6

Comments (0)

Files changed (3)

paverutils/README

   If not using an interpreter, this can be a complete command line.  If using an
   alternate interpreter, it can be some other type of file.
 
+interpreter='python'
+  The external interpreter to use for the program.  Specify 'python',
+  'python3', 'jython', etc.
+
 include_prefix=True
   Boolean controlling whether the ``::`` prefix is included. When chaining multiple
   commands together, the first instance would typically use the default and subsequent
   continued on the next line.  Defaults to 0, meaning no special
   handling should be done.
 
+line_break_mode='break'
+  Mode to control how the line breaks are inserted.  Options are:
+
+    'break'
+      Insert the newline.
+    'wrap'
+      Use the textwrap module to wrap each line individually to the
+      specified width.
+    'fill'
+      Use the textwrap module to wrap each line individually,
+      inserting an appropriate amount of whitespace to keep the left
+      edge of the lines aligned.
+    'continue'
+      Insert a backslash (``\``) and then a newline to break the line.
+    'truncate'
+      Break the line at the indicated location and discard the
+      remainder.
+
 
 .. note::
 
 History
 =======
 
+1.4
+---
+
+- Add different modes for breaking lines in the output of ``run_script()``.  
+
+- Incorporate a fix from Maciek Starzyk for issue #6 so docroot can be
+  set to something other than ``.``.
+
 1.3
 ---
 

paverutils/setup.py

 requires = ['Sphinx>=0.6', 'Paver>=1.0.1']
 
 NAME='sphinxcontrib-paverutils'
-VERSION='1.3'
+VERSION='1.4'
 
 setup(
     name=NAME,

paverutils/sphinxcontrib/paverutils.py

     """
     run_sphinx(options, 'pdf')
     options.order('pdf')
-    latex_dir = path(options.builddir) / options.builder
+    paths = _get_paths(options)
+    latex_dir = paths.builddir / options.builder
     sh('cd %s; make' % latex_dir)
     return
 
     # Set the search order of the options
     options.order(*option_sets, **kwds)
     
-    paths = _get_paths(options)
+    paths = _get_and_create_paths(options)
     template_args = [ '-A%s=%s' % (name, value)
                       for (name, value) in getattr(options, 'template_args', {}).items() 
                       ]
     options.order()
     return
 
+def _get_and_create_paths(options):
+    """Retrieves and creates paths needed to run sphinx.
+
+    Returns a Bundle with the required values filled in.
+    """
+    paths = _get_paths(options)
+    paths.builddir.mkdir()
+    paths.outdir.mkdir()
+    paths.doctrees.mkdir()
+    return paths
 
 def _get_paths(options):
-    """Retrieve and create the paths needed to run sphinx.
+    """Retrieves paths needed to run sphinx.
     
     Returns a Bundle with the required values filled in.
     """
                            % docroot)
     
     builddir = docroot / opts.get("builddir", ".build")
-    builddir.mkdir()
     
     srcdir = docroot / opts.get("sourcedir", "")
     if not srcdir.exists():
         outdir = path(outdir)
     else:
         outdir = builddir / opts.get('builder', 'html')
-    outdir.mkdir()
     
     # Where are doctrees cached?
     doctrees = opts.get('doctrees', '')
         doctrees = builddir / "doctrees"
     else:
         doctrees = path(doctrees)
-    doctrees.mkdir()
 
     return Bunch(locals())
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.