mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-19 23:10:50 +00:00
22 lines
466 B
Python
22 lines
466 B
Python
import os
|
|
import sys
|
|
|
|
CURDIR = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
sys.path.insert(0, os.path.join(CURDIR))
|
|
|
|
import uexpect
|
|
|
|
prompt = ':\) '
|
|
end_of_block = r'.*\r\n.*\r\n'
|
|
|
|
def client(command=None, name='', log=None):
|
|
if command is None:
|
|
client = uexpect.spawn(os.environ.get('CLICKHOUSE_CLIENT'))
|
|
else:
|
|
client = uexpect.spawn(command)
|
|
client.eol('\r')
|
|
client.logger(log, prefix=name)
|
|
client.timeout(2)
|
|
return client
|