#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
       Reporter:  nthiery                                   |         Owner:  
jason, mpatel, was                                             
           Type:  enhancement                               |        Status:  
needs_review                                                   
       Priority:  major                                     |     Milestone:  
sage-5.2                                                       
      Component:  notebook                                  |    Resolution:    
                                                             
       Keywords:  ReST, worksheet                           |   Work issues:    
                                                             
Report Upstream:  Workaround found; Bug reported upstream.  |     Reviewers:  
Nicolas ThiƩry, Jason Grout, Karl-Dieter Crisman, Jason Bandlow
        Authors:  Pablo Angulo, Karl-Dieter Crisman         |     Merged in:    
                                                             
   Dependencies:  #11080, #11459                            |      Stopgaps:    
                                                             
------------------------------------------------------------+---------------

Comment (by jhpalmieri):

 Maybe a patch like the following would allow passing absolute path names
 as arguments:
 {{{
 #!diff
 diff --git a/sage-sws2rst b/sage-sws2rst
 --- a/sage-sws2rst
 +++ b/sage-sws2rst
 @@ -51,10 +51,10 @@ def process_sws(file_name):
      #TODO: python complains about using tempnam, but I don't
      #know hot to fix it or see any danger
  #    tempname = os.tempnam('.')
 -    tempname = os.path.join(tempfile.gettempdir(), file_name)
 -    sws_file.extractall(tempname)
      base_name = os.path.split(os.path.splitext(file_name)[0])[1]
      base_name_clean = base_name.replace(' ','_')
 +    tempname = os.path.join(tempfile.gettempdir(), base_name_clean)
 +    sws_file.extractall(tempname)

      #Images
      images_dir = base_name_clean + '_media'
 }}}
 This needs serious testing, but being unable to pass absolute paths is a
 show-stopper for me. By the way, you could also use `os.path.basename`
 instead of `os.path.split` to define `base_name`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:65>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to