Skip to content

Commit 28e32e1

Browse files
committed
#101 - automate by searching for text on screen
follow-up to the previous commit at - d29333f
1 parent d29333f commit 28e32e1

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

rpa_package/rpa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Apache License 2.0, Copyright 2020 Tebel.Automation Private Limited
33
# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
44
__author__ = 'Ken Soh <[email protected]>'
5-
__version__ = '1.24.0'
5+
__version__ = '1.24.1'
66

77
# for backward compatibility, invoke functions from tagui.py
88
from tagui import *

rpa_package/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
setup(
44
name='rpa',
5-
version='1.24.0',
6-
py_modules=['rpa'], install_requires=['tagui>=1.24.0'],
5+
version='1.24.1',
6+
py_modules=['rpa'], install_requires=['tagui>=1.24.1'],
77
author='Ken Soh',
88
author_email='[email protected]',
99
license='Apache License 2.0',

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='tagui',
5-
version='1.24.0',
5+
version='1.24.1',
66
py_modules=['tagui'],
77
author='Ken Soh',
88
author_email='[email protected]',

tagui.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Apache License 2.0, Copyright 2020 Tebel.Automation Private Limited
33
# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
44
__author__ = 'Ken Soh <[email protected]>'
5-
__version__ = '1.24.0'
5+
__version__ = '1.24.1'
66

77
import subprocess
88
import os
@@ -900,12 +900,9 @@ def exist(element_identifier = None):
900900
print('[RPA][ERROR] - page.png / page.bmp requires init(visual_automation = True)')
901901
return False
902902

903-
# pre-emptive check for existence of specified image file for visual automation
903+
# pre-emptive checks if image files are specified for visual automation
904904
if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'):
905-
if not os.path.isfile(element_identifier):
906-
print('[RPA][ERROR] - missing image file ' + element_identifier)
907-
return False
908-
elif not _visual():
905+
if not _visual():
909906
print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)')
910907
return False
911908

@@ -1088,20 +1085,13 @@ def select(element_identifier = None, option_value = None, test_coordinate1 = No
10881085
option_value = coord(test_coordinate1, test_coordinate2)
10891086

10901087
# pre-emptive checks if image files are specified for visual automation
1091-
# eg without below checks, a missing image file for option will crash
10921088
if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'):
1093-
if not os.path.isfile(element_identifier):
1094-
print('[RPA][ERROR] - missing image file ' + element_identifier)
1095-
return False
1096-
elif not _visual():
1089+
if not _visual():
10971090
print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)')
10981091
return False
10991092

11001093
if option_value.lower().endswith('.png') or option_value.lower().endswith('.bmp'):
1101-
if not os.path.isfile(option_value):
1102-
print('[RPA][ERROR] - missing image file ' + option_value)
1103-
return False
1104-
elif not _visual():
1094+
if not _visual():
11051095
print('[RPA][ERROR] - ' + option_value + ' identifier requires init(visual_automation = True)')
11061096
return False
11071097

@@ -1551,12 +1541,9 @@ def present(element_identifier = None):
15511541
print('[RPA][ERROR] - page.png / page.bmp requires init(visual_automation = True)')
15521542
return False
15531543

1554-
# check for existence of specified image file for visual automation
1544+
# pre-emptive checks if image files are specified for visual automation
15551545
if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'):
1556-
if not os.path.isfile(element_identifier):
1557-
print('[RPA][ERROR] - missing image file ' + element_identifier)
1558-
return False
1559-
elif not _visual():
1546+
if not _visual():
15601547
print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)')
15611548
return False
15621549

0 commit comments

Comments
 (0)