################################# 4. Как использовать? ################################# ****************************** Как запустить? ****************************** Хотите выполнить запуск Оркестратора? **Для этого достаточно (выбрать одно):** - запустить демо-стэнд: запустить .cmd файл, расположенный в папке pyOpenRPA по адресу: Orchestrator\start.cmd (для Windows) и start.sh (для Linux). Далее перейти в браузер по адресу: http://localhost:1024 - в свой .py скрипт добавить следующий код (см. ниже) .. code-block:: python if __name__ == "__main__": # New init way - allow run as module -m PyOpenRPA.Orchestrator from pyOpenRPA import Orchestrator # Import orchestrator main gSettings = SettingsTemplate.Create(inModeStr="BASIC") # Create GSettings with basic configuration - no more config is available from the box - you can create own # Call the orchestrator main def Orchestrator.Orchestrator(inGSettings=gSettings) ************************************************************ Шаблоны функций веб-сервера (с использованием FastAPI) ************************************************************ .. code-block:: python # ПРИМЕР Если НЕ требуется авторизация пользователя (получить inAuthTokenStr) from fastapi import Request from fastapi.responses import JSONResponse, HTMLResponse @app.post("/url/to/def",response_class=JSONResponse) async def some_def(inRequest:Request): l_input_dict = await inRequest.json() if lValueStr == None or lValueStr == b"": lValueStr="" else: lValueStr = lValueStr.decode("utf8") # ПРИМЕР Если требуется авторизация пользователя (получить inAuthTokenStr) from fastapi import Request from fastapi.responses import JSONResponse, HTMLResponse from pyOpenRPA import Orchestrator @app.post("/url/to/def",response_class=JSONResponse) async def some_def(inRequest:Request, inAuthTokenStr:str=Depends(Orchestrator.WebAuthDefGet())): l_input_dict = await inRequest.json() if lValueStr == None or lValueStr == b"": lValueStr="" else: lValueStr = lValueStr.decode("utf8") ****************************** Конфигурационный файл config.py ****************************** Также вы можете выполнить более тонкую настройку параметров Оркестратора. Ниже пример такой настройки: .. include:: ../../../Orchestrator/config.py :literal: ****************************** Быстрая навигация ****************************** - `Сообщество pyOpenRPA (telegram) `_ - `Сообщество pyOpenRPA (tenchat) `_ - `Сообщество pyOpenRPA (вконтакте) `_ - `Презентация pyOpenRPA `_ - `Портал pyOpenRPA `_ - `Репозиторий pyOpenRPA `_