#7846: Missing triple-secret ___code___.py files when copying a worksheet
------------------------+---------------------------------------------------
   Reporter:  mpatel    |       Owner:  was       
       Type:  defect    |      Status:  new       
   Priority:  critical  |   Milestone:  sage-4.3.1
  Component:  notebook  |    Keywords:            
Work_issues:            |      Author:            
   Upstream:  N/A       |    Reviewer:            
     Merged:            |  
------------------------+---------------------------------------------------

Comment(by mpatel):

 Which is better
 {{{
 #!python
 import os, shutil

 def ignore_nonexistent_files(curdir, dirlist):
     ignore = []
     for x in dirlist:
         if not os.path.exists(os.path.join(curdir, x)):
             ignore.append(x)
     return ignore

 # This:
 shutil.copytree('foo', 'bar', ignore=ignore_nonexistent_files)
 # Or this:
 shutil.copytree('foo', 'bar', symlinks=True)
 }}}
 ?  We use [http://docs.python.org/library/shutil.html#shutil.copytree
 shutil.copytree] in 5 places under `sagenb`.  If it's necessary, I can add
 `sagenb.misc.misc.ignore_nonexistent_files`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7846#comment:4>
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