Orchestrator.RDPSessionCMDRun - Fix return + some help comments

dev-linux
Ivan Maslov 4 years ago
parent e5699d0e40
commit 9e2efe7e1b

@ -245,6 +245,7 @@ def SessionCMDRun(inSessionHex,inCMDCommandStr = "echo 1", inModeStr="CROSSCHECK
# Exit fullscreen mode # Exit fullscreen mode
SessionScreenSize_X_Y_W_H(inSessionHex=inSessionHex, inXInt=10, inYInt=10, inWInt=550, SessionScreenSize_X_Y_W_H(inSessionHex=inSessionHex, inXInt=10, inYInt=10, inWInt=550,
inHInt=350) # Prepare little window inHInt=350) # Prepare little window
return lResult
# Check if session is in Full screen mode # Check if session is in Full screen mode
# Return True - is in fullscreen # Return True - is in fullscreen
# example print(Connector.SessionIsFullScreen("")) # example print(Connector.SessionIsFullScreen(""))

@ -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 = { lProcessorActivityDict = {
"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(lResult) inGSettings["ProcessorDict"]["ActivityList"].append(lProcessorActivityDict)
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

Loading…
Cancel
Save