module documentation

Undocumented

Function find_command Undocumented
Function get_command_line_option Return the value of a command line option (which should include leading dashes, e.g. '--testrunner') from an argument list. Return None if the option wasn't passed or if the argument list couldn't be parsed.
Function get_random_secret_key Return a 50 character random string usable as a SECRET_KEY setting value.
Function handle_extensions Organize multiple extensions that are separated with commas or passed by using --extension/-e multiple times.
Function is_ignored_path Check if the given path should be ignored or not based on matching one of the glob style `ignore_patterns`.
Function normalize_path_patterns Normalize an iterable of glob style patterns based on OS.
Function parse_apps_and_model_labels Parse a list of "app_label.ModelName" or "app_label" strings into actual objects and return a two-element tuple: (set of model classes, set of app_configs). Raise a CommandError if some specified models or apps don't exist.
Function popen_wrapper Friendly wrapper around Popen.
Function run_formatters Run the black formatter on the specified files.
def find_command(cmd, path=None, pathext=None): (source)

Undocumented

def get_command_line_option(argv, option): (source)

Return the value of a command line option (which should include leading dashes, e.g. '--testrunner') from an argument list. Return None if the option wasn't passed or if the argument list couldn't be parsed.

def get_random_secret_key(): (source)

Return a 50 character random string usable as a SECRET_KEY setting value.

def handle_extensions(extensions): (source)

Organize multiple extensions that are separated with commas or passed by using --extension/-e multiple times. For example: running 'django-admin makemessages -e js,txt -e xhtml -a' would result in an extension list: ['.js', '.txt', '.xhtml'] >>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py']) {'.html', '.js', '.py'} >>> handle_extensions(['.html, txt,.tpl']) {'.html', '.tpl', '.txt'}

def is_ignored_path(path, ignore_patterns): (source)

Check if the given path should be ignored or not based on matching one of the glob style `ignore_patterns`.

def normalize_path_patterns(patterns): (source)

Normalize an iterable of glob style patterns based on OS.

def parse_apps_and_model_labels(labels): (source)

Parse a list of "app_label.ModelName" or "app_label" strings into actual objects and return a two-element tuple: (set of model classes, set of app_configs). Raise a CommandError if some specified models or apps don't exist.

def popen_wrapper(args, stdout_encoding='utf-8'): (source)

Friendly wrapper around Popen. Return stdout output, stderr output, and OS status code.

def run_formatters(written_files): (source)

Run the black formatter on the specified files.