common.env#
Utility methods and classes used to parse environment values.
Mainly used to get binary paths, such as ffmpeg.
Classes:
|
Utility widget used to edit the binary paths. |
Functions:
|
External binary paths must be set explicitly by the environment or by the user in the user settings. |
|
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:
- 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
, orBOOKMARKS_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