File tree 5 files changed +37
-6
lines changed
5 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 1
1
# RPA for Python :snake :
2
2
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)
4
4
5
5
![ RPA for Python demo in Jupyter notebook] ( https://raw.githubusercontent.com/tebelorg/Tump/master/tagui_python.gif )
6
6
@@ -159,6 +159,7 @@ Function|Parameters|Purpose
159
159
` telegram() ` |` telegram_id ` , ` text_to_send ` (first look up @rpapybot )|send Telegram message
160
160
` keyboard() ` |` keys_and_modifiers ` (using visual automation)|send keystrokes to screen
161
161
` mouse() ` |` 'down' ` or ` 'up' ` (using visual automation)|send mouse event to screen
162
+ ` focus() ` |` app_to_focus ` |make application in focus
162
163
` wait() ` |` delay_in_seconds ` (default 5 seconds)|explicitly wait for some time
163
164
` table() ` |` table number ` or ` XPath ` , ` filename_to_save ` |save webpage table to CSV
164
165
` bin() ` |` file_to_bin ` , ` password ` (optional but recommended)|secure temporary storage
Original file line number Diff line number Diff line change 2
2
# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
3
3
# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
4
4
__author__ = 'Ken Soh <[email protected] >'
5
- __version__ = '1.48.1 '
5
+ __version__ = '1.49.0 '
6
6
7
7
# for backward compatibility, invoke tagui.py functions to use in rpa.py
8
8
from tagui import *
Original file line number Diff line number Diff line change 2
2
3
3
setup (
4
4
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 ' ],
7
7
author = 'Ken Soh' ,
8
8
9
9
license = 'Apache License 2.0' ,
Original file line number Diff line number Diff line change 2
2
3
3
setup (
4
4
name = 'tagui' ,
5
- version = '1.48.1 ' ,
5
+ version = '1.49.0 ' ,
6
6
py_modules = ['tagui' ],
7
7
author = 'Ken Soh' ,
8
8
Original file line number Diff line number Diff line change 2
2
# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
3
3
# https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt
4
4
__author__ = 'Ken Soh <[email protected] >'
5
- __version__ = '1.48.1 '
5
+ __version__ = '1.49.0 '
6
6
7
7
import subprocess
8
8
import os
@@ -1349,6 +1349,36 @@ def mouse(mouse_action = None):
1349
1349
else :
1350
1350
return True
1351
1351
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
+
1352
1382
def table (element_identifier = None , filename_to_save = None ):
1353
1383
if not _started ():
1354
1384
show_error ('[RPA][ERROR] - use init() before using table()' )
You can’t perform that action at this time.
0 commit comments