SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
script.util Namespace Reference

Misc. More...

Functions

None encode_log_map (str path)
 Encodes the last generated log map into a z-lib compressed C binary array.
 
None check_git_submodules (str file_types)
 Checks for missing or uninitalized submodules within project.
 
dict[str, list] get_library_blacklist ()
 Get the library folder blacklist based on core model.
 
bool sync_file (str filePath, str offset, str rawpath, str workingFilePath=None, bool suppress=False)
 Syncs a file between directories.
 
None touch (str rawpath)
 Creates a directory tree.
 
bool available_ram ()
 Get The amount of RAM available in GBs.
 
str hashFile (str filePath)
 Hashes a file.
 

Variables

 LIB_BLACKLIST = join_path("libraries", ".blacklist")
 
bool FILES_CHANGED = False
 
bool RAM_MEMO = False
 
int LOW_RAM = 4
 
int BUF_SIZE = 65536
 

Detailed Description

Misc.

utility functions

Function Documentation

◆ available_ram()

bool script.util.available_ram ( )

Get The amount of RAM available in GBs.

Returns: bool: RAM in GBs

Definition at line 138 of file util.py.

◆ check_git_submodules()

None script.util.check_git_submodules ( str  file_types)

Checks for missing or uninitalized submodules within project.

Args: file_types (str): File types to expect in submodules

Definition at line 36 of file util.py.

◆ encode_log_map()

None script.util.encode_log_map ( str  path)

Encodes the last generated log map into a z-lib compressed C binary array.

Args: path (str): Path to store the C file containing the array

Definition at line 15 of file util.py.

◆ get_library_blacklist()

dict[str, list] script.util.get_library_blacklist ( )

Get the library folder blacklist based on core model.

Returns: dict[str, list]: folder blacklist as a dict

Definition at line 64 of file util.py.

◆ hashFile()

str script.util.hashFile ( str  filePath)

Hashes a file.

Args: filePath (str): Path to the file to hash

Returns: str: HEX string of the file's hash

Definition at line 157 of file util.py.

◆ sync_file()

bool script.util.sync_file ( str  filePath,
str  offset,
str  rawpath,
str   workingFilePath = None,
bool   suppress = False 
)

Syncs a file between directories.

Args: filePath (str): Path to the original file offset (str): Path offset to prepend to the rawpath to get the filepath rawpath (str): Path to the directory the original file is in workingFilePath (str, optional): Path to the file to sync to. Defaults to offset + filepath. suppress (bool, optional): Suppress log messages. Defaults to False.

Returns: bool: Whether the file was synced

Definition at line 91 of file util.py.

◆ touch()

None script.util.touch ( str  rawpath)

Creates a directory tree.

Args: rawpath (str): Path to generate

Definition at line 122 of file util.py.

Variable Documentation

◆ BUF_SIZE

int script.util.BUF_SIZE = 65536

Definition at line 154 of file util.py.

◆ FILES_CHANGED

bool script.util.FILES_CHANGED = False

Definition at line 88 of file util.py.

◆ LIB_BLACKLIST

script.util.LIB_BLACKLIST = join_path("libraries", ".blacklist")

Definition at line 61 of file util.py.

◆ LOW_RAM

int script.util.LOW_RAM = 4

Definition at line 153 of file util.py.

◆ RAM_MEMO

bool script.util.RAM_MEMO = False

Definition at line 135 of file util.py.