Skip to content

Kathara.utils

Tommaso Caiazzi edited this page Mar 18, 2024 · 2 revisions

module Kathara.utils

Global Variables

  • MAC_OS
  • WINDOWS
  • LINUX
  • LINUX2
  • EXCLUDED_FILES
  • RESERVED_MACHINE_NAMES

function check_python_version

check_python_version() → None

function class_for_name

class_for_name(module_name: str, class_name: str) → Any

function generate_urlsafe_hash

generate_urlsafe_hash(string: str) → str

function get_absolute_path

get_absolute_path(path: str) → str

function get_executable_path

get_executable_path(exec_path: str) → Optional[str]

function re_search_fail

re_search_fail(expression: str, line: str) → Match

function list_chunks

list_chunks(iterable: List, size: int) → Generator

function chunk_list

chunk_list(iterable: Union[List, Iterable], size: int) → List[List]

function get_pool_size

get_pool_size() → int

function check_single_not_none_var

check_single_not_none_var(**kwargs) → None

function check_required_single_not_none_var

check_required_single_not_none_var(**kwargs) → None

function is_platform

is_platform(desired_platform: str) → bool

function exec_by_platform

exec_by_platform(
    fun_linux: Callable,
    fun_windows: Callable,
    fun_mac: Callable
) → Any

function pywintypes_import_stub

pywintypes_import_stub() → module

Stub module of pywintypes for Unix systems (so it won't raise any module not found exception).


function pywintypes_import_win

pywintypes_import_win() → module

function import_pywintypes

import_pywintypes() → module

function wait_user_input_linux

wait_user_input_linux() → list

Non-blocking input function for Linux and macOS.


function wait_user_input_windows

wait_user_input_windows() → bool

Return True if an Enter keypress is waiting to be read. Only for Windows.


function convert_win_2_linux

convert_win_2_linux(filename: str, write: bool = False) → Optional[bytes]

function is_admin

is_admin() → bool

function get_current_user_home

get_current_user_home() → str

function get_current_user_uid_gid

get_current_user_uid_gid() → (<class 'int'>, <class 'int'>)

function get_current_user_name

get_current_user_name() → str

function get_current_user_info

get_current_user_info() → Any

function get_architecture

get_architecture() → str

function human_readable_bytes

human_readable_bytes(size_bytes: int) → str

function pack_file_for_tar

pack_file_for_tar(
    file_obj: Union[str, io.IOBase],
    arc_name: str
) → (<class 'tarfile.TarInfo'>, <class 'bytes'>)

function pack_files_for_tar

pack_files_for_tar(guest_to_host: Dict) → bytes

function parse_cd_mac_address

parse_cd_mac_address(value) → Tuple[str, str]

This file was automatically generated via lazydocs.

Clone this wiki locally