diff --git a/Resources/WPy64-3720/settings/.idlerc/recent-files.lst b/Resources/WPy64-3720/settings/.idlerc/recent-files.lst index 4a1957a4..e69de29b 100644 --- a/Resources/WPy64-3720/settings/.idlerc/recent-files.lst +++ b/Resources/WPy64-3720/settings/.idlerc/recent-files.lst @@ -1 +0,0 @@ -C:\Abs\Archive\scopeSrcUL\OpenRPA\WebTest.py diff --git a/Sources/GuideSphinx/Agent/02_Defs.rst b/Sources/GuideSphinx/Agent/02_Defs.rst new file mode 100644 index 00000000..64850fbb --- /dev/null +++ b/Sources/GuideSphinx/Agent/02_Defs.rst @@ -0,0 +1,23 @@ +#################################### +2. Defs +#################################### + +************************************************** +pyOpenRPA.Agent.__Agent__ +************************************************** + + + +.. automodule:: pyOpenRPA.Agent.__Agent__ + :members: + :autosummary: + + +********** +References +********** + +`reStructuredText`_ + +.. target-notes:: +.. _`reStructuredText`: http://docutils.sourceforge.net/rst.html diff --git a/Sources/GuideSphinx/index.rst b/Sources/GuideSphinx/index.rst index 7efc5a9d..9c27d257 100644 --- a/Sources/GuideSphinx/index.rst +++ b/Sources/GuideSphinx/index.rst @@ -154,4 +154,11 @@ Guide content :caption: ORCHESTRATOR :glob: - Orchestrator/* \ No newline at end of file + Orchestrator/* + +.. toctree:: + :maxdepth: 3 + :caption: AGENT + :glob: + + Agent/* \ No newline at end of file diff --git a/Sources/pyOpenRPA/Agent/__Agent__.py b/Sources/pyOpenRPA/Agent/__Agent__.py index bef03241..f58c1bcf 100644 --- a/Sources/pyOpenRPA/Agent/__Agent__.py +++ b/Sources/pyOpenRPA/Agent/__Agent__.py @@ -1,6 +1,7 @@ -import threading, socket, getpass, sys, uuid, subprocess, base64 +import threading, socket, getpass, sys, uuid, subprocess, base64, psutil, getpass from . import O2A, A2O # Data flow Orchestrator To Agent from . import Processor # Processor Queue +from subprocess import CREATE_NEW_CONSOLE # Flag to create new process in another CMD # Create binary file by the base64 string (safe for JSON transmition) def OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str,inGSettings = None): @@ -41,7 +42,7 @@ def OSCMD(inCMDStr, inRunAsyncBool=True, inGSettings = None, inSendOutputToOrche lL = inGSettings.get("Logger",None) if type(inGSettings) is dict else None lResultStr = "" lOSCMDKeyStr = str(uuid.uuid4())[0:4].upper() - lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + lCMDProcess = subprocess.Popen(f'cmd /c {inCMDStr}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, creationflags=CREATE_NEW_CONSOLE) lListenBool = True lMessageStr = f"{lOSCMDKeyStr}: # # # # AGENT CMD Process has been STARTED # # # # " if lL: lL.info(lMessageStr) @@ -76,6 +77,31 @@ def OSCMD(inCMDStr, inRunAsyncBool=True, inGSettings = None, inSendOutputToOrche return lResultStr +def ProcessWOExeUpperUserListGet(): + """ + Return the process list only for the current user (where Agent is running) without .EXE in upper case. Can use in ActivityItem from Orchestrator to Agent + + :param inProcessNameWOExeList: + :return: list of the agent user process in upper case without .EXE. Example ["NOTEPAD","..."], + + """ + lUserNameStr = getpass.getuser() + lResult = [] + # Create updated list for quick check + lProcessNameWOExeList = [] + # Iterate over the list + for proc in psutil.process_iter(): + try: + # Fetch process details as dict + pinfo = proc.as_dict(attrs=['pid', 'name', 'username']) + # Add if empty inProcessNameWOExeList or if process in inProcessNameWOExeList + lUserNameWODomainStr = proc.username().split('\\')[-1] + if lUserNameWODomainStr == lUserNameStr: + lResult.append(pinfo['name'][:-4].upper()) + except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): + pass + return lResult + # Main def def Agent(inGSettings): lL = inGSettings["Logger"] diff --git a/Wiki/ENG_Guide/html/01_HowToInstall.html b/Wiki/ENG_Guide/html/01_HowToInstall.html index 41a406f5..d8024268 100644 --- a/Wiki/ENG_Guide/html/01_HowToInstall.html +++ b/Wiki/ENG_Guide/html/01_HowToInstall.html @@ -116,6 +116,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/02_RoadMap.html b/Wiki/ENG_Guide/html/02_RoadMap.html index 5edc15d8..cae6a53a 100644 --- a/Wiki/ENG_Guide/html/02_RoadMap.html +++ b/Wiki/ENG_Guide/html/02_RoadMap.html @@ -112,6 +112,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/03_Copyrights_Contacts.html b/Wiki/ENG_Guide/html/03_Copyrights_Contacts.html index c70565af..484b8cba 100644 --- a/Wiki/ENG_Guide/html/03_Copyrights_Contacts.html +++ b/Wiki/ENG_Guide/html/03_Copyrights_Contacts.html @@ -116,6 +116,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/Agent/02_Defs.html b/Wiki/ENG_Guide/html/Agent/02_Defs.html new file mode 100644 index 00000000..6ee8e01d --- /dev/null +++ b/Wiki/ENG_Guide/html/Agent/02_Defs.html @@ -0,0 +1,309 @@ + + + + + + + + + + 2. Defs — pyOpenRPA v1.2.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    2. Defs

    +
    +

    pyOpenRPA.Agent.__Agent__

    +

    Functions:

    + ++++ + + + + + + + + + + + +

    OSCMD(inCMDStr[, inRunAsyncBool, …])

    Execute CMD on the Agent daemonic process

    OSFileBinaryDataBase64StrCreate(…[, …])

    Create binary file by the base64 string (safe for JSON transmition)

    ProcessWOExeUpperUserListGet()

    Return the process list only for the current user (where Agent is running) without .EXE in upper case.

    +
    +
    +pyOpenRPA.Agent.__Agent__.OSCMD(inCMDStr, inRunAsyncBool=True, inGSettings=None, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr='cp1251')[source]
    +

    Execute CMD on the Agent daemonic process

    +
    +
    Parameters
    +
      +
    • inCMDStr – command to execute on the Agent session

    • +
    • inRunAsyncBool – True - Agent processor don’t wait execution; False - Agent processor wait cmd execution

    • +
    • inGSettings – Agent global settings dict

    • +
    • inSendOutputToOrchestratorLogsBool – True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True

    • +
    • inCMDEncodingStr – Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test

    • +
    +
    +
    Returns
    +

    +
    +
    +
    + +
    +
    +pyOpenRPA.Agent.__Agent__.OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str, inGSettings=None)[source]
    +

    Create binary file by the base64 string (safe for JSON transmition)

    +
    + +
    +
    +pyOpenRPA.Agent.__Agent__.ProcessWOExeUpperUserListGet()[source]
    +

    Return the process list only for the current user (where Agent is running) without .EXE in upper case. Can use in ActivityItem from Orchestrator to Agent

    +
    +
    Parameters
    +

    inProcessNameWOExeList

    +
    +
    Returns
    +

    list of the agent user process in upper case without .EXE. Example [“NOTEPAD”,”…”],

    +
    +
    +
    + +
    + +
    + + +
    + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/Wiki/ENG_Guide/html/Orchestrator/01_Orchestrator.html b/Wiki/ENG_Guide/html/Orchestrator/01_Orchestrator.html index 5985f7ea..21c97368 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/01_Orchestrator.html +++ b/Wiki/ENG_Guide/html/Orchestrator/01_Orchestrator.html @@ -119,6 +119,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html b/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html index f8486dcf..a0047603 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html +++ b/Wiki/ENG_Guide/html/Orchestrator/02_Defs.html @@ -128,6 +128,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/Orchestrator/03_gSettingsTemplate.html b/Wiki/ENG_Guide/html/Orchestrator/03_gSettingsTemplate.html index 7b929720..c6926692 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/03_gSettingsTemplate.html +++ b/Wiki/ENG_Guide/html/Orchestrator/03_gSettingsTemplate.html @@ -112,6 +112,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/Orchestrator/04_HowToUse.html b/Wiki/ENG_Guide/html/Orchestrator/04_HowToUse.html index c90479ea..979c5fa8 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/04_HowToUse.html +++ b/Wiki/ENG_Guide/html/Orchestrator/04_HowToUse.html @@ -112,6 +112,10 @@
  • 4. How to use
  • 5. UAC - User Access Control
  • +

    AGENT

    + diff --git a/Wiki/ENG_Guide/html/Orchestrator/05_UAC.html b/Wiki/ENG_Guide/html/Orchestrator/05_UAC.html index a0a5dcd1..72aa6c64 100644 --- a/Wiki/ENG_Guide/html/Orchestrator/05_UAC.html +++ b/Wiki/ENG_Guide/html/Orchestrator/05_UAC.html @@ -40,6 +40,7 @@ + @@ -115,6 +116,10 @@ +

    AGENT

    + @@ -237,6 +242,7 @@