-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cpptcl.eval is now a C++ implementation * cpptcl.interpreter.get returns non owning pointer * native to python and python to native dispatching * Create directory per example Bugfixes * import from tcl did not work on nested packages * Python GIL is acquired and released appropriately Library updates * Add winappdbg library wrappers * Update pybind11 to 2.6.2 * Update asmjit to 5bc166efdb419f8 * Update PolyHook 2 to 84d6be2a20 * Update cpptcl to 9384cf9551520
- Loading branch information
ktksgit
committed
May 30, 2021
1 parent
bf85f88
commit e69c456
Showing
286 changed files
with
54,116 additions
and
19,848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#print("Waiting for Visual Python debugger to attach") | ||
# import ptvsd; ptvsd.enable_attach(); ptvsd.wait_for_attach() | ||
|
||
# import pydevd | ||
# pydevd.settrace() | ||
|
||
import os | ||
import sys | ||
import subprocess | ||
import tempfile | ||
import threading | ||
import time | ||
|
||
from pathlib import Path | ||
|
||
import IPython | ||
|
||
connection_file = Path(tempfile.gettempdir()) / 'connection-{:d}.json'.format(os.getpid()) | ||
jupyter_qtconsole_exe = Path(__file__).parent / 'jupyter' / 'qt_console.py' | ||
|
||
|
||
def clean_up_environment_path(): | ||
os_path = [] | ||
for p in os.environ['PATH'].split(';'): | ||
if Path(p).exists() and len(p): | ||
os_path.append(str(p)) | ||
else: | ||
print("Removed from PATH:", str(p)) | ||
os.environ['PATH'] = ';'.join(os_path) + ';' | ||
|
||
|
||
def runner(python_exe, timeout=10): | ||
print(f"Waiting {timeout} sec for {connection_file} to be created") | ||
count_down = timeout | ||
while count_down >= 1 and not connection_file.exists(): | ||
time.sleep(1) | ||
count_down -= 1 | ||
|
||
if not connection_file.exists(): | ||
print(f"{connection_file} does not exist after {timeout} seconds") | ||
return | ||
|
||
count_down = timeout | ||
while count_down >= 1 and len(connection_file.read_text()) < 2: | ||
time.sleep(1) | ||
count_down -= 1 | ||
|
||
if len(connection_file.read_text()) < 2: | ||
print(f"{connection_file} is empty after {timeout} seconds") | ||
return | ||
|
||
# print(os.system(f"cmd.exe /c {jupyter_qtconsole_exe} --existing {connection_file}")) | ||
command = [python_exe, str(jupyter_qtconsole_exe), "--existing", str(connection_file)] | ||
print('Starting:', ' '.join(command)) | ||
proc = subprocess.Popen( | ||
args=command, | ||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, | ||
universal_newlines=True) | ||
|
||
# we need to read. read is a blocking call | ||
print("Process stderr\n", proc.stderr.read()) | ||
print("Process stdout\n", proc.stdout.read()) | ||
|
||
print(f"Closed {jupyter_qtconsole_exe}") | ||
|
||
|
||
def main(python_exe, throw_on_error = False): | ||
clean_up_environment_path() | ||
|
||
t = threading.Thread( | ||
target=runner, | ||
args=[python_exe]) | ||
t.start() | ||
|
||
print("Running IPython embeded kernel") | ||
try: | ||
IPython.embed_kernel( | ||
local_ns=sys._getframe(1).f_locals, | ||
connection_file=str(connection_file), | ||
) | ||
except Exception as exp: | ||
print("Unable to embed IPython. Exception occured:") | ||
print(exp) | ||
if throw_on_error: | ||
raise exp | ||
finally: | ||
if sys.stdout: | ||
sys.stdout.flush() | ||
t.join() | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.executable) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sys | ||
from qtconsole.qtconsoleapp import main | ||
|
||
if __name__ == '__main__': | ||
import re | ||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(main()) |
Empty file.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.