The misc.py
module#
Summary#
Check if the host machine is on Windows. |
|
Get the path for the Mechanical executable file based on the release version. |
|
Decorate a function with this decorator to call it using a thread. |
|
Decorate a function with this decorator to call it using a daemon thread. |
|
Check if the IP address is valid. |
|
Check if the port is valid. |
|
Check if the value obtained from the environmental variable is valid. |
|
Check if a string can be converted to a float. |
Description#
Contain miscellaneous functions and methods at the module level.
Module detail#
- misc.is_windows()#
Check if the host machine is on Windows.
- Returns:
True
if
the
host
machine
is
on
Windows
,False
otherwise.
- misc.get_mechanical_bin(release_version)#
Get the path for the Mechanical executable file based on the release version.
- Parameters:
- release_version: str
Mechanical version using the three-digit format. For example,
"242"
for 2024 R2.
- misc.threaded(func)#
Decorate a function with this decorator to call it using a thread.
- misc.threaded_daemon(func)#
Decorate a function with this decorator to call it using a daemon thread.
- misc.check_valid_port(port, lower_bound=1000, high_bound=60000)#
Check if the port is valid.
- misc.check_valid_start_instance(start_instance)#
Check if the value obtained from the environmental variable is valid.