|
16 | 16 | limitations under the License.
|
17 | 17 |
|
18 | 18 | """
|
| 19 | +from __future__ import print_function |
19 | 20 | import sys
|
20 | 21 | from os.path import isdir, abspath, dirname, join
|
21 | 22 | from os import _exit
|
|
28 | 29 | from tools.options import get_default_options_parser
|
29 | 30 | from tools.options import extract_mcus
|
30 | 31 | from tools.build_api import get_config
|
31 |
| -from config import Config |
32 |
| -from utils import argparse_filestring_type |
| 32 | +from tools.config import Config |
| 33 | +from tools.utils import argparse_filestring_type |
33 | 34 | try:
|
34 | 35 | import tools.private_settings as ps
|
35 | 36 | except:
|
|
62 | 63 | try:
|
63 | 64 | params, macros, features = get_config(options.source_dir, target, toolchain)
|
64 | 65 | if not params and not macros:
|
65 |
| - print "No configuration data available." |
| 66 | + print("No configuration data available.") |
66 | 67 | _exit(0)
|
67 | 68 | if params:
|
68 |
| - print "Configuration parameters" |
69 |
| - print "------------------------" |
| 69 | + print("Configuration parameters") |
| 70 | + print("------------------------") |
70 | 71 | for p in sorted(params):
|
71 | 72 | for s in options.prefix:
|
72 | 73 | if p.startswith(s):
|
73 | 74 | print(str(params[p]) if not options.verbose else params[p].get_verbose_description())
|
74 | 75 | break
|
75 |
| - print "" |
| 76 | + print("") |
76 | 77 |
|
77 |
| - print "Macros" |
78 |
| - print "------" |
| 78 | + print("Macros") |
| 79 | + print("------") |
79 | 80 | if macros:
|
80 |
| - print 'Defined with "macros":', Config.config_macros_to_macros(macros) |
81 |
| - print "Generated from configuration parameters:", Config.parameters_to_macros(params) |
| 81 | + print('Defined with "macros":', Config.config_macros_to_macros(macros)) |
| 82 | + print("Generated from configuration parameters:", Config.parameters_to_macros(params)) |
82 | 83 |
|
83 |
| - except KeyboardInterrupt, e: |
84 |
| - print "\n[CTRL+c] exit" |
85 |
| - except Exception,e: |
| 84 | + except KeyboardInterrupt as e: |
| 85 | + print("\n[CTRL+c] exit") |
| 86 | + except Exception as e: |
86 | 87 | if options.verbose:
|
87 | 88 | import traceback
|
88 | 89 | traceback.print_exc(file=sys.stdout)
|
89 | 90 | else:
|
90 |
| - print "[ERROR] %s" % str(e) |
| 91 | + print("[ERROR] %s" % str(e)) |
91 | 92 |
|
92 | 93 | sys.exit(1)
|
0 commit comments