pyfan.util.path.movefiles

Module Contents

Functions

fp_agg_move_subfiles(spt_root_src='C:/Users/fan/pyfan/vig/support/inout/_folder/fd/faa/', st_srt_srh='_images', st_fle_srh='*', srt_agg='img', ls_srt_dest=['C:/Users/fan/pyfan/vig/support/inout/_folder/fd/faa/', 'C:/Users/fan/pyfan/vig/support/inout/_folder/'], bl_delete_src=True, bl_test=True, verbose=False)

Aggregate and Move a Collection of Non-empty Folders

pyfan.util.path.movefiles.fp_agg_move_subfiles(spt_root_src='C:/Users/fan/pyfan/vig/support/inout/_folder/fd/faa/', st_srt_srh='_images', st_fle_srh='*', srt_agg='img', ls_srt_dest=['C:/Users/fan/pyfan/vig/support/inout/_folder/fd/faa/', 'C:/Users/fan/pyfan/vig/support/inout/_folder/'], bl_delete_src=True, bl_test=True, verbose=False)[source]

Aggregate and Move a Collection of Non-empty Folders

A program (forexample mlx to tex conversion) creates in a folder a number of subfolder that stores images. Aggregate all the various image folders into a common image folder. And then move this common image folder to other destinations in order to flexibly generate aggregation files with common path that rely on images from various subfolders.

Parameters
spt_root_src: string

root folder where subfolders are contained

st_srt_srh: string

gather subfolder names that contain this string

st_fle_srh: string

search in subfolders for files whose name contain string

srt_agg: string

name of subfolder where found folders are aggregated at

ls_srt_dest: :obj:`list` of :obj:`str`

list of folder paths to move aggregate subfolders over to

bl_delete_src: bool

delete folders at existing locations

bl_test: bool

test by searching for paths dest and src, do not move

verbose: bool

print details

Returns
None

nothing is returned

Examples

>>> fp_agg_move_subfiles(spt_root_src="C:/Users/fan/Math4Econ/matrix_application/",
>>>                                          st_srt_srh="_images",
>>>                                          st_fle_srh="*.png",
>>>                                          srt_agg='img',
>>>                                          ls_srt_dest=["C:/Users/fan/Math4Econ/"],
>>>                                          bl_delete_src=False,
>>>                                          bl_test=False,
>>>                                          verbose=False)
pyfan.util.path.movefiles.spt_root_src_u = C:/Users/fan/Math4Econ/matrix_application/[source]