Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image-creator
Commits
710adfb2
Commit
710adfb2
authored
Jun 11, 2012
by
Nikos Skalkotos
Browse files
Print an extra space when new_line=False
parent
96171db1
Changes
1
Hide whitespace changes
Inline
Side-by-side
image_creator/output.py
View file @
710adfb2
...
...
@@ -37,7 +37,7 @@ from colors import red, green, yellow
def
error
(
msg
,
new_line
=
True
,
color
=
True
):
nl
=
"
\n
"
if
new_line
else
''
nl
=
"
\n
"
if
new_line
else
'
'
if
color
:
sys
.
stderr
.
write
(
red
(
'Error: %s'
%
msg
)
+
nl
)
else
:
...
...
@@ -45,7 +45,7 @@ def error(msg, new_line=True, color=True):
def
warn
(
msg
,
new_line
=
True
,
color
=
True
):
nl
=
"
\n
"
if
new_line
else
''
nl
=
"
\n
"
if
new_line
else
'
'
if
color
:
sys
.
stderr
.
write
(
yellow
(
"Warning: %s"
%
msg
)
+
nl
)
else
:
...
...
@@ -53,7 +53,7 @@ def warn(msg, new_line=True, color=True):
def
success
(
msg
,
new_line
=
True
,
color
=
True
):
nl
=
"
\n
"
if
new_line
else
''
nl
=
"
\n
"
if
new_line
else
'
'
if
color
:
sys
.
stdout
.
write
(
green
(
msg
)
+
nl
)
else
:
...
...
@@ -63,7 +63,7 @@ def success(msg, new_line=True, color=True):
def
output
(
msg
=
''
,
new_line
=
True
):
nl
=
"
\n
"
if
new_line
else
''
nl
=
"
\n
"
if
new_line
else
'
'
sys
.
stdout
.
write
(
msg
+
nl
)
if
not
nl
:
sys
.
stdout
.
flush
()
...
...
@@ -155,7 +155,7 @@ class Output_wth_progress(Output_wth_colors):
self
.
goto
(
1
)
def
success
(
self
,
result
):
self
.
output
.
output
(
"
\r
%s...
\033
[K"
%
self
.
title
,
False
)
self
.
output
.
output
(
"
\r
%s...
\033
[K"
%
self
.
title
,
False
)
self
.
output
.
success
(
result
)
...
...
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