def download_log(currentfile=None):
if currentfile == None:<EOL><INDENT>return<EOL><DEDENT>if not currentfile.endswith("<STR_LIT>"):<EOL><INDENT>currentfile=currentfile + "<STR_LIT>"<EOL><DEDENT>list = get_base_ev3dev_cmd() + ['<STR_LIT>','<STR_LIT>']<EOL>list.append(currentfile)<EOL>env = os.environ.copy()<EOL>env["<STR_LIT>"] = THONNY_USER_BASE<EOL>proc = subprocess.Popen(list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,<EOL>universal_newlines=True, env=env)<EOL>dlg = MySubprocessDialog(get_workbench(), proc, "<STR_LIT>", autoclose=True)<EOL>dlg.wait_window()<EOL>if dlg.returncode == <NUM_LIT:0>:<EOL><INDENT>from pathlib import Path<EOL>home = str(Path.home())<EOL>open_file(currentfile,home,True)<EOL><DEDENT>
downloads log of given .py file from EV3.