Changes between Initial Version and Version 1 of Ticket #24068
- Timestamp:
- Jan 1, 2015, 7:54:48 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24068
- Property Needs tests set
- Property Owner changed from to
- Property Status new → assigned
-
Ticket #24068 – Description
initial v1 16 16 {{{#!diff 17 17 diff --git a/django/core/management/base.py b/django/core/management/base.py 18 index 869a11b.. e29bb8a10064418 index 869a11b..dc22d74 100644 19 19 --- a/django/core/management/base.py 20 20 +++ b/django/core/management/base.py 21 @@ -107,11 +107,1 2@@ class OutputWrapper(object):21 @@ -107,11 +107,13 @@ class OutputWrapper(object): 22 22 return getattr(self._out, name) 23 23 24 24 def write(self, msg, style_func=None, ending=None): 25 + style_func = style_func or self.style_func 26 ending = self.ending if ending is None else ending 27 + msg = force_str(style_func(msg)) 28 if ending and not msg.endswith(ending): 29 msg += ending 30 - style_func = style_func or self.style_func 25 - ending = self.ending if ending is None else ending 26 - if ending and not msg.endswith(ending): 27 - msg += ending 28 style_func = style_func or self.style_func 31 29 - self._out.write(force_str(style_func(msg))) 30 + ending = self.ending if ending is None else ending 31 + if ending: 32 + if msg.endswith(ending): 33 + msg = msg[:-len(ending)] 34 + msg = force_str(style_func(msg)) + ending 32 35 + self._out.write(msg) 33 36