From f8973b70da93b7fcb5e51d0748a70622e57bfe98 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sat, 8 Jun 2019 23:49:39 +0300 Subject: [PATCH] =?UTF-8?q?#Robot/UIOSelector=5FAdded|title=5Fre|rich=5Fte?= =?UTF-8?q?xt=5Fre|class=5Fname=5Fre|friendly=5Fclass=5Fname=5Fre|control?= =?UTF-8?q?=5Ftype=5Fre=20#TODO=20=D0=A1=D0=B5=D0=B9=D1=87=D0=B0=D1=81=20?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D1=83=D0=BA=D0=B0=D0=B7=D0=B0=D0=BD?= =?UTF-8?q?=20ctrl=5Findex,=20=D1=82=D0=BE=20title=5Fre=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D1=8F=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F,=20=D1=82=D0=BA=20=D1=83=D0=B4=D0=B0=D0=BB=D1=8F=D0=B5?= =?UTF-8?q?=D1=82=D1=81=D1=8F=20(=D0=BF=D0=BE=D0=B4=D1=83=D0=BC=D0=B0?= =?UTF-8?q?=D1=82=D1=8C,=20=D0=BC=D0=BE=D0=B6=D0=B5=D1=82=20=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B5=20=D0=BD=D0=B0=D0=B4=D0=BE=20=D1=83=D0=B4?= =?UTF-8?q?=D0=B0=D0=BB=D1=8F=D1=82=D1=8C)=20Signed-off-by:=20Ivan=20Maslo?= =?UTF-8?q?v=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Robot/GUI.py | 21 +++++++++++++++++++++ Studio/Web/Index.xhtml | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Robot/GUI.py b/Robot/GUI.py index 9ecb44d5..479cf2dc 100644 --- a/Robot/GUI.py +++ b/Robot/GUI.py @@ -17,6 +17,7 @@ import JSONNormalize from threading import Timer import datetime import logging +import re #Создать файл логирования # add filemode="w" to overwrite if not os.path.exists("Reports"): @@ -158,22 +159,42 @@ def UIOSelector_Get_UIOList (inSpecificationList,inElement=None,inFlagRaiseExcep if 'title' in inSpecificationList[0]: if lChildrenItem.element_info.name != inSpecificationList[0]["title"]: lFlagAddChild=False + #Фильтрация по title_re (regexp) + if 'title_re' in inSpecificationList[0]: + if re.fullmatch(inSpecificationList[0]["title_re"],lChildrenItem.element_info.name) is None: + lFlagAddChild=False #Фильтрация по rich_text if 'rich_text' in inSpecificationList[0]: if lChildrenItem.element_info.rich_text != inSpecificationList[0]["rich_text"]: lFlagAddChild=False + #Фильтрация по rich_text_re (regexp) + if 'rich_text_re' in inSpecificationList[0]: + if re.fullmatch(inSpecificationList[0]["rich_text_re"],lChildrenItem.element_info.rich_text) is None: + lFlagAddChild=False #Фильтрация по class_name if 'class_name' in inSpecificationList[0]: if lChildrenItem.element_info.class_name != inSpecificationList[0]["class_name"]: lFlagAddChild=False + #Фильтрация по class_name_re (regexp) + if 'class_name_re' in inSpecificationList[0]: + if re.fullmatch(inSpecificationList[0]["class_name_re"],lChildrenItem.element_info.class_name) is None: + lFlagAddChild=False #Фильтрация по friendly_class_name if 'friendly_class_name' in inSpecificationList[0]: if lChildrenItem.friendly_class_name() != inSpecificationList[0]["friendly_class_name"]: lFlagAddChild=False + #Фильтрация по friendly_class_name_re (regexp) + if 'friendly_class_name_re' in inSpecificationList[0]: + if re.fullmatch(inSpecificationList[0]["friendly_class_name_re"],lChildrenItem.friendly_class_name) is None: + lFlagAddChild=False #Фильтрация по control_type if 'control_type' in inSpecificationList[0]: if lChildrenItem.element_info.control_type != inSpecificationList[0]["control_type"]: lFlagAddChild=False + #Фильтрация по control_type_re (regexp) + if 'control_type_re' in inSpecificationList[0]: + if re.fullmatch(inSpecificationList[0]["control_type_re"],lChildrenItem.element_info.control_type) is None: + lFlagAddChild=False ##### #Все проверки пройдены - флаг добавления if lFlagAddChild: diff --git a/Studio/Web/Index.xhtml b/Studio/Web/Index.xhtml index c1d9abba..aef0fca4 100644 --- a/Studio/Web/Index.xhtml +++ b/Studio/Web/Index.xhtml @@ -143,7 +143,7 @@ ///Очистить дерево mGlobal.ElementTree.fClear(); ///Прогрузить новое дерево - mGlobal.ElementTree.fRender(lStructureToRender); + mGlobal.ElementTree.fRender(lStructureToRender,$(".openrpa-value-backend")[0].value); } }, dataType: "text" @@ -794,7 +794,7 @@
Edit GUI selector
- [{depth_start: <1+>, depth_end: <1+>, index|ctrl_index: <0+>, title: <str>, rich_text: <str>, class_name: <str>, friendly_class_name: <str>, control_type: <str>}] + [{depth_start: <1+>, depth_end: <1+>, index|ctrl_index: <0+>, title: <str>, title_re: <str re pattern>, rich_text: <str>, rich_text_re: <str re pattern>, class_name: <str>, class_name_re: <str re pattern>, friendly_class_name: <str>, friendly_class_name_re: <str re pattern>, control_type: <str>, control_type_re: <str re pattern>}]