Back to bricks list
Introduction Getting Started
Architecture
Technical Documentation
Other Classes
AbstractDbManager AgentFactory AudioView AuthService BadRequestException BarPlotView Base BaseEnvShell BaseHTTPException BaseModelDTO BaseTestCase BaseTestCaseLight BashCodeParam BoolParam BoolRField BoolValidator BoxPlotView BrickMigration BrickService CheckBeforeTaskResult CommunityService Compress CondaShellProxy Config ConfigParams Connector ConnectorPartSpec ConnectorSpec ConverterRunner Credentials CredentialsDataBasic CredentialsDataLab CredentialsDataOther CredentialsDataS3 CredentialsParam CredentialsType CurrentUserService Dashboard DashboardType DataframeAggregatorHelper DataframeDataFilterHelper DataframeFilterHelper DataFrameRField DataframeScalerHelper datetime DateTimeUTC DbConfig DictRField DictValidator DispatchedMessage DynamicInputs DynamicOutputs EntityNavigator EntityNavigatorService EntityTag EntityType Enum ExceptionHandler ExceptionResponse ExpressionBuilder ExternalApiService FileDownloader FileHelper FileRField FloatParam FloatRField FloatValidator ForbiddenException FrontService FrontTheme FSNodeModel FsNodeService GwsCorePackages GWSException GzipCompress HeatmapView HistogramView ImageView InPort Inputs InputSpec InputSpecs InterfaceSpec IntParam IntRField IntValidator IO IOface Job JsonCodeParam JSONField JSONView JuliaCodeParam KVStore LazyViewParam LinePlot2DView ListParam ListRField ListValidator Logger MailService MambaShellProxy MessageDispatcher MessageLevel MessageObserver Model ModelService Monitor MonitorService MultiViews NetworkView Note Notebook NoteParam NoteSearchBuilder NoteService NoteTemplate NoteTemplateParam NoteTemplateService NotFoundException NumericHelper NumericParam NumericValidator OpenAiChat OpenAiChatMessage OpenAiChatParam OpenAiHelper OutPort Outputs OutputSpec OutputSpecs PackageHelper Paginator ParamSet ParamSpec PerlCodeParam PipShellProxy PlotlyRField PlotlyView PoolDb Port PrimitiveRField Process ProcessFactory ProcessModel ProcessProxy ProcessSpec ProgressBar ProgressBarMessageObserver ProgressBarService ProtocolModel ProtocolProxy ProtocolService ProtocolTyping PythonCodeParam Queue QueueService RCodeParam Requests ResourceDownloaderBase ResourceModel ResourceOrigin ResourceRField ResourceSearchBuilder ResourceService ResourceTransfertService ResourceTyping RField RichText RichTextBlock RichTextBlockModificationDTO RichTextBlockModificationWithUserDTO RichTextBlockType RichTextDTO RichTextFigureData RichTextFileData RichTextFormulaData RichTextListData RichTextListItem RichTextModificationDifferenceDTO RichTextModificationsDTO RichTextModificationType RichTextNoteResourceViewData RichTextObjectType RichTextParagraphData RichTextParagraphHeaderData RichTextParagraphHeaderLevel RichTextParagraphListData RichTextParagraphListItemData RichTextParagraphText RichTextResourceViewData RichTextTimestampData RichTextUserDTO RichTextVariableData RichTextView RichTextViewFileData S3Bucket ScatterPlot2DView Scenario ScenarioCreationType ScenarioProcessStatus ScenarioProxy ScenarioRunService ScenarioSaveDTO ScenarioSearchBuilder ScenarioService ScenarioStatus ScenarioTemplate ScenarioTemplateFactory ScenarioTransfertService SearchBuilder SerializableObjectJson SerializableRField Settings ShellProxy SimpleTextView SpaceFolder SqlMigrator StackedBarPlotView StreamlitApp StreamlitAppManager StreamlitProcess StringHelper StrParam StrRField StrValidator SysProc TableAnnotatorHelper TableColumnSelector TableColumnTagToRowExtractor TableColumnTagUnfolder TableConcatHelper TableHeaderInfo TableOperationHelper TableRowSelector TableRowTagToColumnExtractor TableRowTagUnfolder TableScalerHelper TableTagAggregatorHelper TableUnfolderHelper TableView TabularView Tag TagHelper TagKeyModel TagService TagsParam TagValueModel TarCompress TarGzCompress TaskFileDownloader TaskHelper TaskInputs TaskModel TaskProxy TaskRunner TaskService TaskTyping TechnicalInfo TextParam TextView TextViewData Typing TypingDeprecated TypingIconColor TypingIconType TypingManager TypingStyle UnauthorizedException URLValidator User UserCredentialsDTO UserGroup UserService Utils UUIDRField Validator VennDiagramView Version View ViewTester ViewType YamlCodeParam ZipCompress
Version

ShellProxy

Shell task proxy.

This class is a proxy to Shell commandes. It allow running commands in a shell and get the output and stdout.

Attributes
working_dir: str
Functions
__INIT__

summary

                If not provided, an new temp directory is created. defaults to None
                      Can be useful to log command outputs in task's logs. defaults to None
Parameters:
NameTypeDefault valueDescription
working_dirstr Working directory for the shell (all command will be executed from this dir). , optional
message_dispatcherMessageDispatcher If provided, the output of the command will be redirected to the dispatcher. , optional
ATTACH_OBSERVER

Attach a custom observer to the shell proxy. The logs of the proxy will be dispatch to the observer

Parameters:
NameTypeDefault valueDescription
observerMessageObserver
ATTACH_PROGRESS_BAR

Attach a progress_bar to the shell proxy. The logs of the proxy will be dispatch to the progress_bar logs

Parameters:
NameTypeDefault valueDescription
progress_barProgressBar
CHECK_OUTPUT

Run a command in a shell and return the output.

:raises Exception: description

Parameters:
NameTypeDefault valueDescription
cmdUnion Command to run [list, str]
envdict Environment variables to pass to the shell, defaults to none , optional
shell_modebool False If true, the command is run in a shell, defaults to false , optional
textbool True If true, the output is returned as a string, defaults to true , optional
Return type:
Any
CLEAN_WORKING_DIR
DISPATCH_WAITING_MESSAGES
GET_MESSAGE_DISPATCHER

Get the message dispatcher

Return type:
MessageDispatcher
LOG_ERROR_MESSAGE

Log an error message using the dispatcher

Parameters:
NameTypeDefault valueDescription
messagestr
LOG_INFO_MESSAGE

Log an info message using the dispatcher

Parameters:
NameTypeDefault valueDescription
messagestr
LOG_WARNING_MESSAGE

Log a warining message using the dispatcher

Parameters:
NameTypeDefault valueDescription
messagestr
RUN

Run a command in a shell. The logs of the command will be dispatched to the message dispatcher during the execution.

Parameters:
NameTypeDefault valueDescription
cmdUnion Command to run [list, str]
envdict Environment variables to pass to the shell, defaults to none , optional
shell_modebool False If true, the command is run in a shell, defaults to false , optional
Return type:
int
RUN_IN_NEW_THREAD

Run a command in a shell without blocking the thread. The logs of the command will be dispatched to the message dispatcher during the execution.

Parameters:
NameTypeDefault valueDescription
cmdUnion Command to run [list, str]
envdict Environment variables to pass to the shell, defaults to none , optional
shell_modebool False If true, the command is run in a shell, defaults to false , optional
Return type:
SysProc