fixed debug console

dev
Bill 2 years ago
parent 8a5941abe2
commit 4974db3117

@ -69,9 +69,9 @@ There're multiple options to run AQuery on Windows. You can use the native toolc
In this case, upgrade anaconda or your compiler or use the python from your OS or package manager instead. Or (**NOT recommended**) copy/link the library from your system (e.g. /usr/lib/x86_64-linux-gnu/libstdc++.so.6) to anaconda's library directory (e.g. ~/Anaconda3/lib/). In this case, upgrade anaconda or your compiler or use the python from your OS or package manager instead. Or (**NOT recommended**) copy/link the library from your system (e.g. /usr/lib/x86_64-linux-gnu/libstdc++.so.6) to anaconda's library directory (e.g. ~/Anaconda3/lib/).
### Docker: ### Docker:
- Alternatively, you can also use docker to run AQuery. - See installation instructions from [docker.com](https://www.docker.com). Run docker desktop to start docker engine.
- Type `make docker` to build the docker image from scratch. - In AQuery root directory, type `make docker` to build the docker image from scratch.
- For Arm-based Mac users, you would have to build and run the x86_64 docker image because MonetDB doesn't offer official binaries for arm64 Linux. (Run `docker buildx build --platform=linux/amd64 -t aquery .` instead of `make docker`) - For Arm-based Mac users, you would have to build and run the **x86_64** docker image because MonetDB doesn't offer official binaries for arm64 Linux. (Run `docker buildx build --platform=linux/amd64 -t aquery .` instead of `make docker`)
- Finally run the image in **interactive** mode (`docker run -it --rm aquery`) - Finally run the image in **interactive** mode (`docker run -it --rm aquery`)
## Usage ## Usage
`python3 prompt.py` will launch the interactive command prompt. The server binary will be automatically rebuilt and started. `python3 prompt.py` will launch the interactive command prompt. The server binary will be automatically rebuilt and started.

@ -397,11 +397,15 @@ def prompt(running = lambda:True, next = lambda:input('> '), state = None):
from copy import deepcopy from copy import deepcopy
var = {**globals(), **locals()} var = {**globals(), **locals()}
sh = code.InteractiveConsole(var) sh = code.InteractiveConsole(var)
__stdin = os.dup(0)
try: try:
sh.interact(banner = 'debugging session began.', exitmsg = 'debugging session ended.') sh.interact(banner = 'debugging session began.', exitmsg = 'debugging session ended.')
except BaseException as e: except BaseException as e:
# don't care about anything happened in interactive console # dont care about whatever happened in dbg session
print(e) print(e)
finally:
import io
sys.stdin = io.TextIOWrapper(io.BufferedReader(io.FileIO(__stdin, mode='rb', closefd=False)), encoding='utf8')
continue continue
elif q.startswith('log'): elif q.startswith('log'):
qs = re.split(r'[ \t]', q) qs = re.split(r'[ \t]', q)

Loading…
Cancel
Save