common.env#

Utility methods and classes used to parse environment values.

Mainly used to get binary paths, such as ffmpeg.

Classes:

EnvPathEditor([parent])

Utility widget used to edit the binary paths.

Functions:

get_binary(binary_name)

External binary paths must be set explicitly by the environment or by the user in the user settings.

get_user_setting(binary_name)

Check if there's a corresponding user setting for the given binary name.

class bookmarks.common.env.EnvPathEditor(parent=None)[source]#

Bases: QWidget

Utility widget used to edit the binary paths.

Methods:

init_data()

Initializes data.

pick(name)

Pick a binary file from the file explorer.

reveal(name)

Reveal a binary file in the file explorer.

init_data()[source]#

Initializes data.

pick(name)[source]#

Pick a binary file from the file explorer.

reveal(name)[source]#

Reveal a binary file in the file explorer.

Parameters:

name (str) – The name of the binary file to be revealed.

bookmarks.common.env.get_binary(binary_name)[source]#

External binary paths must be set explicitly by the environment or by the user in the user settings.

Bookmarks will look for user defined binary paths, or failing that, environment values in a {PREFIX}_{BINARY_NAME} format, e.g. BOOKMARKS_FFMPEG, or BOOKMARKS_RV. These environment variables should point to an appropriate executable, e.g. BOOKMARKS_FFMPEG=C:/ffmpeg/ffmpeg.exe

If the environment variable is absent, we’ll look at the PATH environment to see if the binary is available there.

Parameters:

binary_name (str) – One of the pre-defined external binary names. E.g. ffmpeg.

Returns:

Path to an executable binary, or None if the binary is not found.

Return type:

str

bookmarks.common.env.get_user_setting(binary_name)[source]#

Check if there’s a corresponding user setting for the given binary name.

The user settings are stored using the binary name prefixed with a ‘bin’, like so: bin_ffmpeg.

Parameters:

binary_name (str) – The name of the binary.

Returns:

Path to a binary or None if there’s no value found.

Return type:

str