core.helpers module

Helper functions.

core.helpers.detect_installed_file(current_file, test_files)[source]

Returns the file in <test_files> which is contained in <current_file>, or “Unknown”.

core.helpers.detect_installed_files(current_file, test_files)[source]

Returns a list of files in <test_files> that are contained in <current_file>.

core.helpers.get_resource(filename)[source]

If running in a bundle, this will point to the place internal resources are located; if running the script directly, no modification takes place.

Parameters:

filename (str) – the ordinary path to the resource

Returns:

(str) – Path for bundled filename

core.helpers.get_text_files(directory)[source]

Returns a list of .txt files in <directory>. Excludes all filenames beginning with “readme” (case-insensitive).

Parameters:

directory – the directory to search.

core.helpers.key_from_underscore_prefixed_string(s)[source]

Converts a string to a key such that strings prefixed with an underscore will be sorted before other strings.

core.helpers.os_is_64bit()[source]

Returns true if running on a 64-bit OS.