You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Orchestrator/Demo/BUYER_01/config.py

43 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from pyOpenRPA import Orchestrator
from pyOpenRPA.Orchestrator.Managers import ControlPanel
import time
import os
import sys
import socket
import datetime
import urllib.parse
from pyOpenRPA.Orchestrator.Server import app
import threading
from fastapi import Depends
from fastapi.responses import PlainTextResponse
from fastapi.responses import FileResponse
time.sleep(1.5)
g_cp_name_str = "BUYER_01"
g_repo_name_str = os.path.abspath(__file__).split("\\")[-5]
g_repo_package_cp_path_str = os.path.abspath("\\".join(os.path.abspath(__file__).split("\\")[:-1]))
# Подключени файлов связанных с роботом-казначеем01
@app.get(path="/BUYER_01/scripts",tags=["BUYER_01"])
def get_file():
return FileResponse("Demo\\BUYER_01\\buyer_01.js")
# User settings
g_host_str = socket.gethostname().upper() # Identify PC
g_control_panel = ControlPanel(inControlPanelNameStr=g_cp_name_str,
inRefreshHTMLJinja2TemplatePathStr=os.path.join(g_repo_package_cp_path_str, "index.html"),
inJinja2TemplateRefreshBool=True,inRobotNameStr=g_repo_name_str)
g_jinja_context_dict = {"settings": sys.modules[__name__],
"urllib_parse_quote_plus": urllib.parse.quote_plus, "g_host_str": g_host_str, "g_repo_name_str": g_repo_name_str}
g_control_panel.Jinja2DataUpdateDictSet(inJinja2DataUpdateDict=g_jinja_context_dict)