def _copyToNewWorkingDir(newdir,input):
    """ Copy input file and all related files necessary for processing to the new working directory.

        This function works in a greedy manner, in that all files associated
        with all inputs(have the same rootname) will be copied to the new
        working directory.
    """
    flist = []
    if '_asn.fits' in input:
        asndict = asnutil.readASNTable(input,None)
        flist.append(input[:input.find('_')])
        flist.extend(asndict['order'])
        flist.append(asndict['output'])
    else:
        flist.append(input[:input.find('_')])
    # copy all files related to these rootnames into new dir
    for rootname in flist:
        for fname in glob.glob(rootname+'*'):
            shutil.copy(fname,os.path.join(newdir,fname))
def _copyToNewWorkingDir ( newdir , input ) : flist = [ ] if '_asn.fits' in input : asndict = asnutil . readASNTable ( input , None ) flist . append ( input [ : input . find ( '_' ) ] ) flist . extend ( asndict [ 'order' ] ) flist . append ( asndict [ 'output' ] ) else : flist . append ( input [ : input . find ( '_' ) ] ) for rootname in flist : for fname in glob . glob ( rootname + '*' ) : shutil . copy ( fname , os . path . join ( newdir , fname ) )
Copy input file and all related files necessary for processing to the new working directory.

        This function works in a greedy manner, in that all files associated
        with all inputs(have the same rootname) will be copied to the new
        working directory.