SUAVE  2.5.2
An Aerospace Vehicle Environment for Designing Future Aircraft
SUAVE.Core.redirect.folder Class Reference
Inheritance diagram for SUAVE.Core.redirect.folder:

Public Member Functions

def __init__ (self, folder, pull=None, link=None, force=True)
 
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_value, traceback)
 

Public Attributes

 origin
 
 folder
 
 pull
 
 push
 
 link
 
 force
 

Detailed Description

Temporarily redirects to a working folder, pulling 
    and pushing needed files
    
    Example:
    
    folder = 'temp'                    
    pull   = ['file1.txt','file2.txt'] 
    link   = ['file3.big']             
    force  = True                      
    
    # original path
    import os
    print os.getcwd()
    
    # enter folder
    with SU2.io.redirect_folder(folder,pull,link,force) as push:
        print os.getcwd()
        # code
        push.append('file4.txt')
    #: with folder redirection
    
    # returned to original path
    print os.getcwd()
    
    Inputs:
        folder - working folder, relative or absolute
        pull   - list of files to pull (copy to working folder)
        link   - list of files to link (symbolic link in working folder)
        force  - True/False overwrite existing files in working folder
    
    Targets:
        push   - list of files to push (copy to originating path)
    
    Notes:
        push must be appended or extended, not overwritten
        links in Windows not supported, will simply copy

Constructor & Destructor Documentation

◆ __init__()

def SUAVE.Core.redirect.folder.__init__ (   self,
  folder,
  pull = None,
  link = None,
  force = True 
)
folder redirection initialization
    see help( folder ) for more info

The documentation for this class was generated from the following file: