videof2b.core.common package
Submodules
videof2b.core.common.path module
Path-related utilities.
- videof2b.core.common.path.files_to_paths(file_names)
Convert a list of file names to a list of file Path objects.
- Parameters:
file_names (list[str]) – The list of file names to convert.
- Returns:
The list converted to file paths
- Return type:
list[Path]
- videof2b.core.common.path.path_to_str(path=None)
Convert a Path object or NoneType to a string equivalent.
- Parameters:
path (Path | None) – The value to convert to a string
- Returns:
An empty string if path is None, else a string representation of the path
- Return type:
str
- videof2b.core.common.path.replace_params(args, kwargs, params)
Transform the specified args or kwargs
- Parameters:
args (tuple) – Positional arguments
kwargs (dict) – Keyword arguments
params – A tuple of tuples with the position and the keyword to replace
- Returns:
The modified positional and keyword arguments
- Return type:
tuple[tuple, dict]
Usage: Given a method with the following signature, assume we want to apply the str function to arg2: def method(arg1=None, arg2=None, arg3=None)
Since arg2 can be specified positionally as the second argument (1 with a zero index) or as a keyword, we would call this function as follows: `replace_params(args, kwargs, ((1, ‘arg2’, str),))
- videof2b.core.common.path.str_to_path(string)
Convert a str object to a Path or NoneType.
This is especially useful because constructing a Path object with an empty string causes the Path object to point to the current working directory, which is not desirable.
- Parameters:
string (str) – The string to convert
- Returns:
None if string is empty, or a Path object representation of string
- Return type:
Path | None
videof2b.core.common.settings module
Module for handling persistent settings.
- class videof2b.core.common.settings.Settings(*args, **kwargs)
Bases:
QSettingsSimple wrapper around QSettings. Contains core definitions of all known keys and their default values. Does not contain a strategy for versioning of settings. Handles lookup of default values in the most basic manner.
- staticMetaObject = PySide6.QtCore.QMetaObject("Settings" inherits "QSettings": )
- value(key)
Return the value for the given key. The key must exist in Settings.__defaults__. If value not found, return the value from Settings.__defaults__
videof2b.core.common.singleton module
Contains the Singleton class definition.
- class videof2b.core.common.singleton.Singleton
Bases:
typeImplementation of a Singleton metaclass.
videof2b.core.common.store module
This module contains objects that enable persistence of custom data.
- class videof2b.core.common.store.Store(*args, **kwargs)
Bases:
objectAn object store. This is a singleton that provides access to object references that are shared within a process.
- add(key, item)
Add an item to the store.
- classmethod create()
The constructor for the Store.
- get(key)
Get the specified object from the store.
- remove(key)
Remove an item from the store.
Module contents
Common definitions and constants for VideoF2B.
- class videof2b.core.common.FigureTypes(value)
Bases:
EnumAll F2B figures in sequence.
- FOUR_LEAF_CLOVER = 14
- HORIZONTAL_EIGHTS = 9
- HORIZONTAL_SQUARE_EIGHTS = 10
- HOURGLASS = 12
- INSIDE_LOOPS = 3
- INSIDE_SQUARE_LOOPS = 6
- INSIDE_TRIANGULAR_LOOPS = 8
- INVERTED_FLIGHT = 4
- LANDING = 15
- OUTSIDE_LOOPS = 5
- OUTSIDE_SQUARE_LOOPS = 7
- OVERHEAD_EIGHTS = 13
- REVERSE_WINGOVER = 2
- TAKEOFF = 1
- VERTICAL_EIGHTS = 11
- class videof2b.core.common.SphereManipulations(value)
Bases:
EnumPossible manipulations of the AR sphere during processing.
- MOVE_EAST = 4
- MOVE_NORTH = 5
- MOVE_SOUTH = 6
- MOVE_WEST = 3
- RESET_CENTER = 0
- ROTATE_CCW = 1
- ROTATE_CW = 2
- videof2b.core.common.get_app_metadata()
Get basic app information. Returns (name, version) as a tuple of strings.
- Return type:
Tuple
- videof2b.core.common.get_bundle_dir()
Return the path of the bundle directory. When frozen as a one-file app, this is the _MEI### dir in temp. When frozen as a one-dir app, this is that dir. When running as a script, this is the project’s root dir.
- videof2b.core.common.get_frozen_path(path_when_frozen, path_when_non_frozen)
Return one of the given paths based on status of sys.frozen.
- videof2b.core.common.get_lib_versions()
Get User-friendly names and versions of libraries that we care about for bug reports. This is just a sub-list of install_requires items in our setup.cfg.
- videof2b.core.common.is_linux()
Returns True if running on a Linux OS.
- Return type:
bool- Returns:
True if running on a Linux OS.
- videof2b.core.common.is_win()
Returns True if running on a Windows OS.
- Return type:
bool- Returns:
True if running on a Windows OS.
- videof2b.core.common.launch_document(path)
Open the specified document using the default application.
- Return type:
None