Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
f-interop-contributors
utils
Commits
a7ed7d38
Commit
a7ed7d38
authored
Sep 18, 2017
by
Federico Sismondi
Browse files
added new version of CLI for running interop tests
parent
1437d12a
Changes
1
Hide whitespace changes
Inline
Side-by-side
user_interface.py
0 → 100644
View file @
a7ed7d38
import
click
from
prompt_toolkit
import
prompt
from
prompt_toolkit.history
import
FileHistory
from
prompt_toolkit.auto_suggest
import
AutoSuggestFromHistory
from
prompt_toolkit.contrib.completers
import
WordCompleter
SQLCompleter
=
WordCompleter
([
'select'
,
'from'
,
'insert'
,
'update'
,
'delete'
,
'drop'
],
ignore_case
=
True
)
if
__name__
==
'__main__'
:
cli
=
click
.
Group
(
short_help
=
'hola'
)
session_url
=
click
.
Option
(
param_decls
=
[
"--url"
],
default
=
"amqp://guest:guest@localhost/"
,
required
=
True
,
help
=
"AMQP url provided by F-Interop"
)
connect_command
=
click
.
Command
(
"connect"
,
callback
=
print
,
params
=
[
session_url
,
],
short_help
=
"Connect with authentication AMQP_URL, and some other basic agent configurations."
)
cli
.
add_command
(
connect_command
)
while
1
:
user_input
=
prompt
(
'SQL>'
,
history
=
FileHistory
(
'history.txt'
),
auto_suggest
=
AutoSuggestFromHistory
(),
completer
=
SQLCompleter
,
)
print
(
'# entered: '
+
user_input
)
#click.echo_via_pager(user_input)
try
:
cli
()
except
Exception
as
e
:
print
(
e
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment