@ -1041,27 +1041,38 @@ def RDPSessionCMDRun(inGSettings, inRDPSessionKeyStr, inCMDStr, inModeStr="CROSS
: param inGSettings : Global settings dict ( singleton )
: param inRDPSessionKeyStr :
: param inCMDStr :
: param inModeStr :
: return : True - CMD was executed successfully
: param inModeStr : Variants :
" LISTEN " - Get result of the cmd command in result ;
" CROSSCHECK " - Check if the command was successufully sent
" RUN " - Run without crosscheck and get clipboard
: return : # OLD > True - CMD was executed successfully
{
" OutStr " : < > # Result string
" IsResponsibleBool " : True | False # Flag is RDP is responsible - works only when inModeStr = CROSSCHECK
}
"""
lResult = {
" OutStr " : None , # Result string
" IsResponsibleBool " : False # Flag is RDP is responsible - works only when inModeStr = CROSSCHECK
}
# Check thread
if not Core . IsProcessorThread ( inGSettings = inGSettings ) :
if inGSettings [ " Logger " ] : inGSettings [ " Logger " ] . warning ( f " RDP def was called not from processor queue - activity will be append in the processor queue. " )
lResult = {
l ProcessorActivityDic t = {
" Def " : RDPSessionCMDRun , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inCMDStr " : inCMDStr , " inModeStr " : inModeStr } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
" ArgLogger " : None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
}
inGSettings [ " ProcessorDict " ] [ " ActivityList " ] . append ( l Resul t)
inGSettings [ " ProcessorDict " ] [ " ActivityList " ] . append ( l ProcessorActivityDic t)
else :
lResult = True
#lResult = True
# Calculate the session Hex
lSessionHex = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] . get ( inRDPSessionKeyStr , { } ) . get ( " SessionHex " , None )
# Run CMD
if lSessionHex :
Connector. SessionCMDRun ( inSessionHex = lSessionHex , inCMDCommandStr = inCMDStr , inModeStr = inModeStr , inLogger = inGSettings [ " Logger " ] ,
lResult = Connector. SessionCMDRun ( inSessionHex = lSessionHex , inCMDCommandStr = inCMDStr , inModeStr = inModeStr , inLogger = inGSettings [ " Logger " ] ,
inRDPConfigurationItem = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ] )
return lResult