1
1
#! /usr/bin/env python3
2
- """This script helps you configuring the connections for all the supported
3
- remote backends. In time, it will also guide you to retrieve the tokens,
4
- passwords, etc... but for now, it is a prerequisite that you already have these
5
- credentials to use this script.
2
+ """The ``setup_connections`` script helps you configuring the connections for
3
+ all the supported remote backends. In time, it will also guide you to retrieve
4
+ the tokens, passwords, etc... but for now, it is a prerequisite that you already
5
+ have these credentials to use this script.
6
6
7
- Information concerning which provider is configured and related
8
- credentials are stored in the ``~/.mpqp`` file."""
7
+ Information concerning which provider is configured and related credentials are
8
+ stored in the ``~/.mpqp`` file."""
9
9
10
- import mpqp .execution .connection .aws_connection as awsc
11
- import mpqp .execution .connection .env_manager as env_m
12
- import mpqp .execution .connection .ibm_connection as ibmqc
13
- import mpqp .execution .connection .qlm_connection as qlmc
14
- from mpqp .tools .choice_tree import AnswerNode , QuestionNode , run_choice_tree
15
- from mpqp .tools .errors import IBMRemoteExecutionError
10
+ import os
11
+
12
+ os .environ ["FOR_DISABLE_CONSOLE_CTRL_HANDLER" ] = "1"
16
13
17
14
18
15
def print_config_info ():
16
+ import mpqp .execution .connection .aws_connection as awsc
17
+ import mpqp .execution .connection .env_manager as env_m
18
+ import mpqp .execution .connection .ibm_connection as ibmqc
19
+ from mpqp .tools .errors import IBMRemoteExecutionError
20
+
19
21
"""Prints the info concerning each provider's registered account."""
20
22
print ("===== IBM Quantum info : ===== " )
21
23
try :
@@ -45,6 +47,10 @@ def print_config_info():
45
47
def main_setup ():
46
48
"""Function called by the script bellow to setup all connections or to get
47
49
information about the existing ones."""
50
+ import mpqp .execution .connection .aws_connection as awsc
51
+ import mpqp .execution .connection .ibm_connection as ibmqc
52
+ import mpqp .execution .connection .qlm_connection as qlmc
53
+ from mpqp .tools .choice_tree import AnswerNode , QuestionNode , run_choice_tree
48
54
49
55
setup_tree = QuestionNode (
50
56
"~~~~~ MPQP REMOTE CONFIGURATION ~~~~~" ,
@@ -63,4 +69,7 @@ def main_setup():
63
69
64
70
65
71
if __name__ == "__main__" :
66
- main_setup ()
72
+ try :
73
+ main_setup ()
74
+ except KeyboardInterrupt :
75
+ exit ()
0 commit comments