Revision 46544c32 image_creator/main.py
b/image_creator/main.py | ||
---|---|---|
37 | 37 |
from image_creator import util |
38 | 38 |
from image_creator.disk import Disk |
39 | 39 |
from image_creator.util import get_command, FatalError, MD5 |
40 |
from image_creator.output import Output, Output_with_progress, Silent, error |
|
40 |
from image_creator.output import Output, Output_wth_progress, Silent, \ |
|
41 |
Silent_wth_colors, error |
|
41 | 42 |
from image_creator.os_type import get_os_class |
42 | 43 |
from image_creator.kamaki_wrapper import Kamaki |
43 | 44 |
import sys |
... | ... | |
159 | 160 |
"must be set") |
160 | 161 |
|
161 | 162 |
if options.silent: |
162 |
out = Silent() |
|
163 |
out = Silent_wth_colors() if sys.stdout.isatty() else Silent()
|
|
163 | 164 |
else: |
164 |
out = Output_with_progress()
|
|
165 |
out = Output_wth_progress() if sys.stdout.isatty() else Output()
|
|
165 | 166 |
|
166 | 167 |
title = 'snf-image-creator %s' % version |
167 | 168 |
out.output(title) |
... | ... | |
281 | 282 |
ret = image_creator() |
282 | 283 |
sys.exit(ret) |
283 | 284 |
except FatalError as e: |
284 |
error(e) |
|
285 |
if sys.stdout.isatty(): |
|
286 |
error(e) |
|
287 |
else: |
|
288 |
error(e, True, False) |
|
285 | 289 |
sys.exit(1) |
286 | 290 |
|
287 | 291 |
|
Also available in: Unified diff