commands

Il modulo commands.py espone le funzionalità per l’esecuzione di comandi esterni al programma.

Consente l’esecuzione di comandi in base all’OS host.

aziona.core.commands.exec(command: str, shell: bool = True, **kargs)object[sorgente]

Esegue un comando attraverso il subprocess per recuperare il processo eseguito

Args:

command (str): il comando da eseguire shell (bool,optional): opzione subprocess **kargs(dict): opzioni del comando subprocess.check_call

Returns:

object

Raises:

Exception

aziona.core.commands.exec_check(command, **kargs)None[sorgente]

Esegue un comando attraverso il subprocess

Args:

command(str,dict): il comando da eseguire **kargs(dict): opzioni del comando subprocess.check_call

Returns:

void

Raises:

Exception generiche

aziona.core.commands.exec_output(command: str, shell: bool = True, with_raise: bool = True, decode: bool = True, **kargs)str[sorgente]

Esegue un comando attraverso il subprocess per recuperare il suo output in formato stringa

Args:

command (str): il comando da eseguire shell (bool,optional): opzione subprocess with_raise (bool,optional): se true cattura l’eccezione se false ritorna la stringa dell’errore decode (bool,optional): decodifica l’output **kargs(dict): opzioni del comando subprocess.check_call

Returns:

str: output del comando eseguito

Raises:

Exception