datamanwithvan.utils package

Submodules

datamanwithvan.utils.messages module

class datamanwithvan.utils.messages.DatamanwithvanMessages[source]

Bases: object

err_fn_no_found = 'Function not found'
err_no_quiet_and_verbose = "Quiet & verbose params can't be set together"
msg_error_cant_fetch_rep_rule = 'Unable to fetch replication rules'
msg_error_no_cnf_pro = 'No Datamanwithvan config file was specified...'
msg_error_no_conf = 'Unable to find a usable configuration. Exiting now..'
msg_info_load_conf = 'Loading configuration from file'
msg_info_repl_rule_exist = 'All good, rest not implemented yet'
msg_info_version_number = '0.1.9'
msg_info_welcome = "\n    ___      _                          __    __ _ _   _                   __\n   /   \\__ _| |_ __ _  /\\/\\   __ _ _ __/ / /\\ \\ (_| |_| |____   ____ _  /\\ \\ \\\n  / /\\ / _` | __/ _` |/    \\ / _` | '_ \\ \\/  \\/ | | __| '_ \\ \\ / / _` |/  \\/ /\n / /_/| (_| | || (_| / /\\/\\ | (_| | | | \\  /\\  /| | |_| | | \\ V | (_| / /\\  /\n/___,' \\__,_|\\__\\__,_\\/    \\/\\__,_|_| |_|\\/  \\/ |_|\\__|_| |_|\\_/ \\__,_\\_\\ \\/\n"
msg_warn_no_rep_rule = 'This job has no active rules to run'
pkgname = 'datamanwithvan'
warn_not_implemented = 'Not implemented yet'

datamanwithvan.utils.statuscodes module

class datamanwithvan.utils.statuscodes.StatusCodes[source]

Bases: object

_summary_

conf_loading_success = 3
stat_code_cnf_not_exist = 5
stat_code_conf_not_provided = 6
stat_code_enough_disk_space = 2
stat_code_generic = 0
stat_code_not_enough_disk_space = 1
stat_code_quiet_verbose = 7
status_cnf_not_load = 4

datamanwithvan.utils.utils module

class datamanwithvan.utils.utils.Utils[source]

Bases: object

_summary_

Returns:

_description_

Return type:

_type_

StatusCodesObj = <datamanwithvan.utils.statuscodes.StatusCodes object>
dummy_attribute = None
generate_random_string(length)[source]

Generate a random string of specified length containing numbers and Latin characters.

Parameters: - length (int): The length of the string to be generated.

Returns: - str: A random string of specified length.

has_enough_disk_space(path, size_in_bytes)[source]

_summary_

Parameters:
  • path (_type_) – _description_

  • size_in_bytes (_type_) – _description_

Returns:

_description_

Return type:

_type_

select_random_element(from_array)[source]

Select a random element from the given array.

Parameters: array (list): The array from which to select a random element.

Returns: element: A random element from the array.

Module contents