File tree Expand file tree Collapse file tree 5 files changed +37
-6
lines changed
Expand file tree Collapse file tree 5 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 11# RPA for Python :snake :
22
3- [**v1.48**](https://github.com/tebelorg/RPA-Python/releases) • [**Use Cases**](#use-cases) • [**API Reference**](#api-reference) • [**About & Credits**](#about--credits) • [**Try on Cloud**](https://colab.research.google.com/drive/1or8DtXZP8ZxJYK52me0dA6O9A1dXKKOE?usp=sharing) • [**PyCon Video**](https://www.youtube.com/watch?v=F2aQKWx_EAE) • [**Telegram Chat**](https://t.me/pythonrpa) • [*中文*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=zh-CN&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*हिन्दी*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=hi&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Español*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Français*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=fr&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*عربى*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=ar&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*বাংলা*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=bn&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Русский*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=ru&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Português*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=pt&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Bahasa*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=id&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Deutsch*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*More..*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=sr&_x_tr_hl=en-US&_x_tr_pto=wapp)
3+ [**v1.49**](https://github.com/tebelorg/RPA-Python/releases) • [**Use Cases**](#use-cases) • [**API Reference**](#api-reference) • [**About & Credits**](#about--credits) • [**Try on Cloud**](https://colab.research.google.com/drive/1or8DtXZP8ZxJYK52me0dA6O9A1dXKKOE?usp=sharing) • [**PyCon Video**](https://www.youtube.com/watch?v=F2aQKWx_EAE) • [**Telegram Chat**](https://t.me/pythonrpa) • [*中文*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=zh-CN&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*हिन्दी*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=hi&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Español*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Français*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=fr&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*عربى*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=ar&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*বাংলা*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=bn&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Русский*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=ru&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Português*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=pt&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Bahasa*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=id&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*Deutsch*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=en-US&_x_tr_pto=wapp) • [*More..*](https://github-com.translate.goog/tebelorg/RPA-Python?_x_tr_sl=en&_x_tr_tl=sr&_x_tr_hl=en-US&_x_tr_pto=wapp)
44
55![ RPA for Python demo in Jupyter notebook] ( https://raw.githubusercontent.com/tebelorg/Tump/master/tagui_python.gif )
66
@@ -159,6 +159,7 @@ Function|Parameters|Purpose
159159` telegram() ` |` telegram_id ` , ` text_to_send ` (first look up @rpapybot )|send Telegram message
160160` keyboard() ` |` keys_and_modifiers ` (using visual automation)|send keystrokes to screen
161161` mouse() ` |` 'down' ` or ` 'up' ` (using visual automation)|send mouse event to screen
162+ ` focus() ` |` app_to_focus ` |make application in focus
162163` wait() ` |` delay_in_seconds ` (default 5 seconds)|explicitly wait for some time
163164` table() ` |` table number ` or ` XPath ` , ` filename_to_save ` |save webpage table to CSV
164165` bin() ` |` file_to_bin ` , ` password ` (optional but recommended)|secure temporary storage
Original file line number Diff line number Diff line change 22# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
33# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
44__author__ = 'Ken Soh <[email protected] >' 5- __version__ = '1.48.1 '
5+ __version__ = '1.49.0 '
66
77# for backward compatibility, invoke tagui.py functions to use in rpa.py
88from tagui import *
Original file line number Diff line number Diff line change 22
33setup (
44 name = 'rpa' ,
5- version = '1.48.1 ' ,
6- py_modules = ['rpa' ], install_requires = ['tagui>=1.48.1 ' ],
5+ version = '1.49.0 ' ,
6+ py_modules = ['rpa' ], install_requires = ['tagui>=1.49.0 ' ],
77 author = 'Ken Soh' ,
8899 license = 'Apache License 2.0' ,
Original file line number Diff line number Diff line change 22
33setup (
44 name = 'tagui' ,
5- version = '1.48.1 ' ,
5+ version = '1.49.0 ' ,
66 py_modules = ['tagui' ],
77 author = 'Ken Soh' ,
88
Original file line number Diff line number Diff line change 22# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
33# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
44__author__ = 'Ken Soh <[email protected] >' 5- __version__ = '1.48.1 '
5+ __version__ = '1.49.0 '
66
77import subprocess
88import os
@@ -1349,6 +1349,36 @@ def mouse(mouse_action = None):
13491349 else :
13501350 return True
13511351
1352+ def focus (app_to_focus = None ):
1353+ if app_to_focus is None or app_to_focus == '' :
1354+ show_error ('[RPA][ERROR] - app to focus missing for focus()' )
1355+ return False
1356+
1357+ else :
1358+ if platform .system () == 'Windows' :
1359+ # download sendKeys.bat if not present
1360+ if not os .path .isfile ('sendKeys.bat' ):
1361+ sendKeys_url = 'https://github.com/tebelorg/Tump/releases/download/v1.0.0/sendKeys.bat'
1362+ if not download (sendKeys_url , 'sendKeys.bat' ):
1363+ show_error ('[RPA][ERROR] - cannot download sendKeys.bat for focus()' )
1364+ return False
1365+ if os .system ('sendKeys.bat "' + app_to_focus + '" "" > nul 2>&1' ) == 0 :
1366+ return True
1367+ else :
1368+ show_error ('[RPA][ERROR] - ' + app_to_focus + ' not found for focus()' )
1369+ return False
1370+
1371+ elif platform .system () == 'Darwin' :
1372+ if os .system ('osascript -e \' tell application "' + app_to_focus + '" to activate\' > /dev/null 2>&1' ) == 0 :
1373+ return True
1374+ else :
1375+ show_error ('[RPA][ERROR] - ' + app_to_focus + ' not found for focus()' )
1376+ return False
1377+
1378+ else :
1379+ show_error ('[RPA][ERROR] - Linux not supported for focus()' )
1380+ return False
1381+
13521382def table (element_identifier = None , filename_to_save = None ):
13531383 if not _started ():
13541384 show_error ('[RPA][ERROR] - use init() before using table()' )
You can’t perform that action at this time.
0 commit comments