@ -348,6 +348,45 @@ def AgentOSFileBinaryDataBase64StrReceive(inHostNameStr, inUserStr, inFilePathSt
#Send item in AgentDict for the futher data transmition
#Send item in AgentDict for the futher data transmition
return AgentActivityItemAdd ( inGSettings = inGSettings , inHostNameStr = inHostNameStr , inUserStr = inUserStr , inActivityItemDict = lActivityItemDict )
return AgentActivityItemAdd ( inGSettings = inGSettings , inHostNameStr = inHostNameStr , inUserStr = inUserStr , inActivityItemDict = lActivityItemDict )
def AgentOSFileBinaryDataReceive ( inHostNameStr , inUserStr , inFilePathStr ) :
"""
Read binary file from agent ( synchronious )
: param inGSettings : Global settings dict ( singleton )
: param inHostNameStr :
: param inUserStr :
: param inFilePathStr : File path to read
: return : file data bytes
"""
lFileDataBytes = None
inGSettings = GSettingsGet ( ) # Set the global settings
# Check thread
if OrchestratorIsInited ( ) == False :
if inGSettings [ " Logger " ] : inGSettings [ " Logger " ] . warning ( f " AgentOSFileBinaryDataReceive run before orc init - activity will be append in the processor queue. " )
lResult = {
" Def " : AgentOSFileBinaryDataReceive , # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inHostNameStr " : inHostNameStr , " inUserStr " : inUserStr , " inFilePathStr " : inFilePathStr } , # Args dictionary
" ArgGSettings " : 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 )
else : # In processor - do execution
lActivityItemDict = {
" Def " : " OSFileBinaryDataBase64StrReceive " , # def alias (look pyOpeRPA.Agent gSettings["ProcessorDict"]["AliasDefDict"])
" ArgList " : [ ] , # Args list
" ArgDict " : { " inFilePathStr " : inFilePathStr } , # 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)
}
#Send item in AgentDict for the futher data transmition
lGUIDStr = AgentActivityItemAdd ( inGSettings = inGSettings , inHostNameStr = inHostNameStr , inUserStr = inUserStr , inActivityItemDict = lActivityItemDict )
lFileBase64Str = AgentActivityItemReturnGet ( inGUIDStr = lGUIDStr )
if lFileBase64Str is not None : lFileDataBytes = base64 . b64decode ( lFileBase64Str )
return lFileDataBytes
def AgentOSFileTextDataStrReceive ( inHostNameStr , inUserStr , inFilePathStr , inEncodingStr = " utf-8 " , inGSettings = None ) :
def AgentOSFileTextDataStrReceive ( inHostNameStr , inUserStr , inFilePathStr , inEncodingStr = " utf-8 " , inGSettings = None ) :
"""
"""
Read text file in the agent GUI session
Read text file in the agent GUI session
@ -1987,7 +2026,7 @@ def SchedulerActivityTimeAddWeekly(inTimeHHMMStr="23:55:", inWeekdayList=None, i
# # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # #
def RDPTemplateCreate ( inLoginStr , inPasswordStr , inHostStr = " 127.0.0.1 " , inPortInt = 3389 , inWidthPXInt = 1680 , inHeightPXInt = 1050 ,
def RDPTemplateCreate ( inLoginStr , inPasswordStr , inHostStr = " 127.0.0.1 " , inPortInt = 3389 , inWidthPXInt = 1680 , inHeightPXInt = 1050 ,
inUseBothMonitorBool = False , inDepthBitInt = 32 , inSharedDriveList = None ):
inUseBothMonitorBool = False , inDepthBitInt = 32 , inSharedDriveList = None , inRedirectClipboardBool = True ):
"""
"""
Create RDP connect dict item / Use it connect / reconnect ( Orchestrator . RDPSessionConnect )
Create RDP connect dict item / Use it connect / reconnect ( Orchestrator . RDPSessionConnect )
@ -2010,6 +2049,7 @@ def RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr="127.0.0.1", inPortIn
# "Host": "127.0.0.1", "Port": "3389", "Login": "USER_99", "Password": "USER_PASS_HERE",
# "Host": "127.0.0.1", "Port": "3389", "Login": "USER_99", "Password": "USER_PASS_HERE",
# "Screen": { "Width": 1680, "Height": 1050, "FlagUseAllMonitors": False, "DepthBit": "32" },
# "Screen": { "Width": 1680, "Height": 1050, "FlagUseAllMonitors": False, "DepthBit": "32" },
# "SharedDriveList": ["c"],
# "SharedDriveList": ["c"],
# "RedirectClipboardBool": True, # True - share clipboard to RDP; False - else
# ###### Will updated in program ############
# ###### Will updated in program ############
# "SessionHex": "77777sdfsdf77777dsfdfsf77777777", # Hex is created when robot runs, example ""
# "SessionHex": "77777sdfsdf77777dsfdfsf77777777", # Hex is created when robot runs, example ""
# "SessionIsWindowExistBool": False, "SessionIsWindowResponsibleBool": False, "SessionIsIgnoredBool": False
# "SessionIsWindowExistBool": False, "SessionIsWindowResponsibleBool": False, "SessionIsIgnoredBool": False
@ -2024,6 +2064,7 @@ def RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr="127.0.0.1", inPortIn
: param inUseBothMonitorBool : True - connect to the RDP with both monitors . False - else case
: param inUseBothMonitorBool : True - connect to the RDP with both monitors . False - else case
: param inDepthBitInt : Remote desktop bitness . Available : 32 or 24 or 16 or 15 , example 32
: param inDepthBitInt : Remote desktop bitness . Available : 32 or 24 or 16 or 15 , example 32
: param inSharedDriveList : Host local disc to connect to the RDP session . Example : [ " c " , " d " ]
: param inSharedDriveList : Host local disc to connect to the RDP session . Example : [ " c " , " d " ]
: param inRedirectClipboardBool : # True - share clipboard to RDP; False - else
: return :
: return :
{
{
" Host " : inHostStr , # Host address, example "77.77.22.22"
" Host " : inHostStr , # Host address, example "77.77.22.22"
@ -2038,6 +2079,7 @@ def RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr="127.0.0.1", inPortIn
" DepthBit " : str ( inDepthBitInt ) # "32" or "24" or "16" or "15", example "32"
" DepthBit " : str ( inDepthBitInt ) # "32" or "24" or "16" or "15", example "32"
} ,
} ,
" SharedDriveList " : inSharedDriveList , # List of the Root sesion hard drives, example ["c"]
" SharedDriveList " : inSharedDriveList , # List of the Root sesion hard drives, example ["c"]
" RedirectClipboardBool " : True , # True - share clipboard to RDP; False - else
###### Will updated in program ############
###### Will updated in program ############
" SessionHex " : " 77777sdfsdf77777dsfdfsf77777777 " , # Hex is created when robot runs, example ""
" SessionHex " : " 77777sdfsdf77777dsfdfsf77777777 " , # Hex is created when robot runs, example ""
" SessionIsWindowExistBool " : False ,
" SessionIsWindowExistBool " : False ,
@ -2050,6 +2092,7 @@ def RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr="127.0.0.1", inPortIn
"""
"""
if inSharedDriveList is None : inSharedDriveList = [ " c " ]
if inSharedDriveList is None : inSharedDriveList = [ " c " ]
if inPortInt is None : inPortInt = 3389
if inPortInt is None : inPortInt = 3389
if inRedirectClipboardBool is None : inRedirectClipboardBool = True
lRDPTemplateDict = { # Init the configuration item
lRDPTemplateDict = { # Init the configuration item
" Host " : inHostStr , # Host address, example "77.77.22.22"
" Host " : inHostStr , # Host address, example "77.77.22.22"
" Port " : str ( inPortInt ) , # RDP Port, example "3389"
" Port " : str ( inPortInt ) , # RDP Port, example "3389"
@ -2062,7 +2105,8 @@ def RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr="127.0.0.1", inPortIn
" FlagUseAllMonitors " : inUseBothMonitorBool , # True or False, example False
" FlagUseAllMonitors " : inUseBothMonitorBool , # True or False, example False
" DepthBit " : str ( inDepthBitInt ) # "32" or "24" or "16" or "15", example "32"
" DepthBit " : str ( inDepthBitInt ) # "32" or "24" or "16" or "15", example "32"
} ,
} ,
" SharedDriveList " : inSharedDriveList , # List of the Root sesion hard drives, example ["c"]
" SharedDriveList " : inSharedDriveList , # List of the Root sesion hard drives, example ["c"],
" RedirectClipboardBool " : inRedirectClipboardBool , # True - share clipboard to RDP; False - else
###### Will updated in program ############
###### Will updated in program ############
" SessionHex " : " 77777sdfsdf77777dsfdfsf77777777 " , # Hex is created when robot runs, example ""
" SessionHex " : " 77777sdfsdf77777dsfdfsf77777777 " , # Hex is created when robot runs, example ""
" SessionIsWindowExistBool " : False ,
" SessionIsWindowExistBool " : False ,
@ -2087,7 +2131,7 @@ def RDPSessionDublicatesResolve(inGSettings):
#for lItemKeyStr in inGSettings["RobotRDPActive"]["RDPList"]:
#for lItemKeyStr in inGSettings["RobotRDPActive"]["RDPList"]:
# lItemDict = inGSettings["RobotRDPActive"]["RDPList"][lItemKeyStr]
# lItemDict = inGSettings["RobotRDPActive"]["RDPList"][lItemKeyStr]
def RDPSessionConnect ( inRDPSessionKeyStr , inRDPTemplateDict = None , inHostStr = None , inPortStr = None , inLoginStr = None , inPasswordStr = None , inGSettings = None ):
def RDPSessionConnect ( inRDPSessionKeyStr , inRDPTemplateDict = None , inHostStr = None , inPortStr = None , inLoginStr = None , inPasswordStr = None , inGSettings = None , inRedirectClipboardBool = True ):
"""
"""
Create new RDPSession in RobotRDPActive . Attention - activity will be ignored if RDP key is already exists
Create new RDPSession in RobotRDPActive . Attention - activity will be ignored if RDP key is already exists
2 way of the use
2 way of the use
@ -2137,7 +2181,7 @@ def RDPSessionConnect(inRDPSessionKeyStr, inRDPTemplateDict=None, inHostStr=None
# Var 2 - backward compatibility
# Var 2 - backward compatibility
if lRDPConfigurationItem is None :
if lRDPConfigurationItem is None :
lRDPConfigurationItem = RDPTemplateCreate ( inLoginStr = inLoginStr , inPasswordStr = inPasswordStr ,
lRDPConfigurationItem = RDPTemplateCreate ( inLoginStr = inLoginStr , inPasswordStr = inPasswordStr ,
inHostStr = inHostStr , inPortInt = int ( inPortStr ) ) # ATTENTION - dont connect if RDP session is exist
inHostStr = inHostStr , inPortInt = int ( inPortStr ) , inRedirectClipboardBool = inRedirectClipboardBool ) # ATTENTION - dont connect if RDP session is exist
# Start the connect
# Start the connect
if inRDPSessionKeyStr not in inGSettings [ " RobotRDPActive " ] [ " RDPList " ] :
if inRDPSessionKeyStr not in inGSettings [ " RobotRDPActive " ] [ " RDPList " ] :
inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ] = lRDPConfigurationItem # Add item in RDPList
inGSettings [ " RobotRDPActive " ] [ " RDPList " ] [ inRDPSessionKeyStr ] = lRDPConfigurationItem # Add item in RDPList