|
1 | 1 | """INTEGRATION ENGINE FOR TAGUI PYTHON PACKAGE ~ TEBEL.ORG"""
|
2 | 2 | __author__ = 'Ken Soh <[email protected]>'
|
3 |
| -__version__ = '1.5.0' |
| 3 | +__version__ = '1.6.0' |
4 | 4 |
|
5 | 5 | import subprocess
|
6 | 6 | import os
|
@@ -179,15 +179,18 @@ def _tagui_delta(base_directory = None):
|
179 | 179 | if os.path.isfile(base_directory + '/' + 'tagui_python_' + __version__): return True
|
180 | 180 |
|
181 | 181 | # define list of key tagui files to be downloaded and synced locally
|
182 |
| - delta_list = ['tagui', 'tagui.cmd', 'tagui_header.js', 'tagui_parse.php', 'tagui.sikuli/tagui.py'] |
| 182 | + delta_list = ['tagui', 'tagui.cmd', 'end_processes', 'end_processes.cmd', |
| 183 | + 'tagui_header.js', 'tagui_parse.php', 'tagui.sikuli/tagui.py'] |
| 184 | + |
183 | 185 | for delta_file in delta_list:
|
184 | 186 | tagui_delta_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/TagUI-Python/' + delta_file
|
185 | 187 | tagui_delta_file = base_directory + '/' + 'src' + '/' + delta_file
|
186 | 188 | if not download(tagui_delta_url, tagui_delta_file): return False
|
187 | 189 |
|
188 |
| - # make sure execute permission is there for .tagui/src/tagui |
| 190 | + # make sure execute permission is there for .tagui/src/tagui and end_processes |
189 | 191 | if platform.system() in ['Linux', 'Darwin']:
|
190 | 192 | os.system('chmod -R 755 ' + base_directory + '/' + 'src' + '/' + 'tagui > /dev/null 2>&1')
|
| 193 | + os.system('chmod -R 755 ' + base_directory + '/' + 'src' + '/' + 'end_processes > /dev/null 2>&1') |
191 | 194 |
|
192 | 195 | # create marker file to skip syncing delta files next time for current release
|
193 | 196 | delta_done_file = _py23_open(base_directory + '/' + 'tagui_python_' + __version__, 'w')
|
@@ -399,6 +402,7 @@ def init(visual_automation = False, chrome_browser = True):
|
399 | 402 | tagui_directory = os.path.expanduser('~') + '/' + '.tagui'
|
400 | 403 |
|
401 | 404 | tagui_executable = tagui_directory + '/' + 'src' + '/' + 'tagui'
|
| 405 | + end_processes_executable = tagui_directory + '/' + 'src' + '/' + 'end_processes' |
402 | 406 |
|
403 | 407 | # if tagui executable is not found, initiate setup() to install tagui
|
404 | 408 | if not os.path.isfile(tagui_executable):
|
@@ -441,7 +445,11 @@ def init(visual_automation = False, chrome_browser = True):
|
441 | 445 |
|
442 | 446 | # entry shell command to invoke tagui process
|
443 | 447 | tagui_cmd = tagui_executable + ' tagui_python ' + browser_option
|
444 |
| - |
| 448 | + |
| 449 | + # run tagui end processes script to flush dead processes |
| 450 | + # for eg execution ended with ctrl+c or forget to close() |
| 451 | + os.system(end_processes_executable) |
| 452 | + |
445 | 453 | try:
|
446 | 454 | # launch tagui using subprocess
|
447 | 455 | _process = subprocess.Popen(
|
|
0 commit comments