Package shelljob :: Module fs
[hide private]
[frames] | no frames]

Module fs

source code

A collection of filesystem related commands.

Classes [hide private]
  NamedTempFile
Creates a temporary file for a 'with' block.
Functions [hide private]
 
find(path, include_dirs=True, include_files=True, name_regex=None, not_name_regex=None, whole_name_regex=None, not_whole_name_regex=None, exclude_root=False, relative=False, limit_depth=None)
Creates an iterator of files matching a variety of conditions.
source code
Variables [hide private]
  __package__ = 'shelljob'
Function Details [hide private]

find(path, include_dirs=True, include_files=True, name_regex=None, not_name_regex=None, whole_name_regex=None, not_whole_name_regex=None, exclude_root=False, relative=False, limit_depth=None)

source code 

Creates an iterator of files matching a variety of conditions.

Parameters:
  • path - which path to iterate
  • include_dirs - include directories in output
  • include_files - include files in output
  • name_regex - optional regex string compared against basename of file
  • not_name_regex - if specificed only produces names not matching this regex
  • whole_name_regex - like name_regex but applies to whole path, not just basename
  • not_whole_name_regex - like not_name_regex but applies to whole path
  • exclude_root - do not include the intput 'path' itself in the output
  • limit_depth - do not list items deeper than this level from root
  • relative - filenames are relative to "path" as opposed to appended to path
Returns:
a generator for the matched files