@ -1041,27 +1041,38 @@ def RDPSessionCMDRun(inGSettings, inRDPSessionKeyStr, inCMDStr, inModeStr="CROSS
: param inGSettings : Global settings dict ( singleton )
: param inGSettings : Global settings dict ( singleton )
: param inRDPSessionKeyStr :
: param inRDPSessionKeyStr :
: param inCMDStr :
: param inCMDStr :
: param inModeStr :
: param inModeStr : Variants :
: return : True - CMD was executed successfully
" 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
# Check thread
if not Core . IsProcessorThread ( inGSettings = inGSettings ) :
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. " )
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"])
" Def " : RDPSessionCMDRun , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inCMDStr " : inCMDStr , " inModeStr " : inModeStr } , # Args dictionary
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inCMDStr " : inCMDStr , " inModeStr " : inModeStr } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
" ArgLogger " : None # 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 :
else :
lResult = True
#lResult = True
# Calculate the session Hex
# Calculate the session Hex
lSessionHex = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] . get ( inRDPSessionKeyStr , { } ) . get ( " SessionHex " , None )
lSessionHex = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] . get ( inRDPSessionKeyStr , { } ) . get ( " SessionHex " , None )
# Run CMD
# Run CMD
if lSessionHex :
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 ] )
inRDPConfigurationItem = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ] )
return lResult
return lResult