betterSIS BetterSIS Code Documentation
BETTERSIS: The modern shell for SIS
- class bettersis.bettersis.Bettersis[source]
Shows bettersis’ interactive shell.
After the creation of an instance a SIS process is ready to receive commands.
Note
The SIS process is started and controlled by the siswrapper. library
Shared variables:
res: dictionary with results of the start operation (success, errors, stdout)sis: connection to SIS’s processlastcmd: contains the last commandlastcmd_success: boolean that is set to True if the last command execution was successfullhistory_file_path: path to the history file (used whenBSIS_HISTORY_ENABLEDenvironment variable is “true”)
- bottom_toolbar()[source]
Returns message to show inside the toolbar at the bottom.
- Return str toolbar:
toolbar message
- bsiscmd_cd(t_path)[source]
Changes current directory to the
<t_path>directory.- Parameters:
t_path (str) – new working path
- bsiscmd_edit(t_path)[source]
Opens the
<t_path>file with the text editor.- Parameters:
t_path (str) – path of the file to open.
- bsiscmd_ls(t_path)[source]
Lists files and directories inside the
<t_path>folder.- Parameters:
t_path (str) – path in which to execute the “ls” command
- manage_bsis_command(t_command)[source]
Executes the
<t_command>command betterSIS.- Parameters:
t_command (str) – custom betterSIS command to execute
- manage_command(t_command)[source]
Executes the
<t_command>command using SIS.- Parameters:
t_command (str) – command to execute using SIS
- manage_history_file()[source]
Manages the history file size and usage.
Checks if the
BSIS_HISTORY_ENABLEDenvironment variable is set to true: if is is set to true the function returns True and betterSIS will use the history file, else the history will expire at the end of the session.Then, if a history file already exists, checks the
BSIS_HISTORY_SIZELIMITenvironment: if the value is a number it is used as a size limit, else the limit is the default one (0.1 MB)