@ -250,7 +250,7 @@ def RDPSessionDisconnect(inGSettings, inRDPSessionKeyStr, inBreakTriggerProcessW
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 = {
" Def " : RDPSession C onnect, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" Def " : RDPSession Disc onnect, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inBreakTriggerProcessWOExeList " : inBreakTriggerProcessWOExeList } , # Args dictionary
" ArgGSettings " : " inGSettings " , # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -271,6 +271,18 @@ def RDPSessionDisconnect(inGSettings, inRDPSessionKeyStr, inBreakTriggerProcessW
# RDP Session reconnect
def RDPSessionReconnect ( inGSettings , inRDPSessionKeyStr ) :
# 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 = {
" Def " : RDPSessionReconnect , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr } , # 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 ( lResult )
else :
lRDPConfigurationItem = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ]
RDPSessionDisconnect ( inRDPSessionKeyStr = inRDPSessionKeyStr ) # Disconnect the RDP
# Add item in RDPList
@ -288,6 +300,18 @@ def RDPSessionMonitorStop(inGSettings, inRDPSessionKeyStr):
# Logoff the RDP session
def RDPSessionLogoff ( inGSettings , inRDPSessionKeyStr , inBreakTriggerProcessWOExeList = [ ] ) :
lResult = True
# 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 = {
" Def " : RDPSessionLogoff , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inBreakTriggerProcessWOExeList " : inBreakTriggerProcessWOExeList } , # 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 ( lResult )
else :
lCMDStr = " shutdown -L " # CMD logoff command
# Calculate the session Hex
lSessionHex = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] . get ( inRDPSessionKeyStr , { } ) . get ( " SessionHex " , None )
@ -303,6 +327,18 @@ def RDPSessionLogoff(inGSettings, inRDPSessionKeyStr, inBreakTriggerProcessWOExe
# Check RDP Session responsibility TODO NEED DEV + TEST
def RDPSessionResponsibilityCheck ( inGSettings , inRDPSessionKeyStr ) :
# 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 = {
" Def " : RDPSessionResponsibilityCheck , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr } , # 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 ( lResult )
else :
lRDPConfigurationItem = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ] # Get the alias
# set the fullscreen
# ATTENTION!!! Session hex can be updated!!!
@ -328,6 +364,18 @@ def RDPSessionResponsibilityCheck(inGSettings, inRDPSessionKeyStr):
# Start process if it is not running
def RDPSessionProcessStartIfNotRunning ( inGSettings , inRDPSessionKeyStr , inProcessNameWEXEStr , inFilePathStr , inFlagGetAbsPathBool = True ) :
# 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 = {
" Def " : RDPSessionProcessStartIfNotRunning , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inProcessNameWEXEStr " : inProcessNameWEXEStr , " inFilePathStr " : inFilePathStr , " inFlagGetAbsPathBool " : inFlagGetAbsPathBool } , # 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 ( lResult )
else :
lResult = True
lCMDStr = CMDStr . ProcessStartIfNotRunning ( inProcessNameWEXEStr , inFilePathStr , inFlagGetAbsPath = inFlagGetAbsPathBool )
# Calculate the session Hex
@ -340,6 +388,18 @@ def RDPSessionProcessStartIfNotRunning(inGSettings, inRDPSessionKeyStr, inProces
def RDPSessionCMDRun ( inGSettings , inRDPSessionKeyStr , inCMDStr , 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 = {
" 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 ( lResult )
else :
lResult = True
# Calculate the session Hex
lSessionHex = inGSettings [ " RobotRDPActive " ] [ " RDPList " ] . get ( inRDPSessionKeyStr , { } ) . get ( " SessionHex " , None )
@ -350,6 +410,18 @@ def RDPSessionCMDRun(inGSettings, inRDPSessionKeyStr, inCMDStr, inModeStr="CROSS
return lResult
# Create CMD str to stop process
def RDPSessionProcessStop ( inGSettings , inRDPSessionKeyStr , inProcessNameWEXEStr , inFlagForceCloseBool ) :
# 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 = {
" Def " : RDPSessionProcessStop , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inProcessNameWEXEStr " : inProcessNameWEXEStr , " inFlagForceCloseBool " : inFlagForceCloseBool } , # 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 ( lResult )
else :
lResult = True
lCMDStr = f ' taskkill /im " { inProcessNameWEXEStr } " /fi " username eq %USERNAME% " '
if inFlagForceCloseBool :
@ -362,6 +434,18 @@ def RDPSessionProcessStop(inGSettings, inRDPSessionKeyStr, inProcessNameWEXEStr,
return lResult
# Send file from Host to Session RDP using shared drive in RDP
def RDPSessionFileStoredSend ( inGSettings , inRDPSessionKeyStr , inHostFilePathStr , inRDPFilePathStr ) :
# 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 = {
" Def " : RDPSessionFileStoredSend , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inHostFilePathStr " : inHostFilePathStr , " inRDPFilePathStr " : inRDPFilePathStr } , # 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 ( lResult )
else :
lResult = True
lCMDStr = CMDStr . FileStoredSend ( inHostFilePath = inHostFilePathStr , inRDPFilePath = inRDPFilePathStr )
# Calculate the session Hex
@ -373,6 +457,18 @@ def RDPSessionFileStoredSend(inGSettings, inRDPSessionKeyStr, inHostFilePathStr,
return lResult
# Recieve file from Session RDP to Host using shared drive in RDP
def RDPSessionFileStoredRecieve ( inGSettings , inRDPSessionKeyStr , inRDPFilePathStr , inHostFilePathStr ) :
# 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 = {
" Def " : RDPSessionFileStoredRecieve , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inRDPSessionKeyStr " : inRDPSessionKeyStr , " inRDPFilePathStr " : inRDPFilePathStr , " inHostFilePathStr " : inHostFilePathStr } , # 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 ( lResult )
else :
lResult = True
lCMDStr = CMDStr . FileStoredRecieve ( inRDPFilePath = inRDPFilePathStr , inHostFilePath = inHostFilePathStr )
# Calculate the session Hex