Made various parts of the core respect the CLIENT_DEFAULT_WIDTH setting. Resolves #710.
This commit is contained in:
parent
a01493bfa0
commit
c781160225
7 changed files with 35 additions and 24 deletions
|
|
@ -115,11 +115,14 @@ table string.
|
|||
|
||||
"""
|
||||
#from textwrap import wrap
|
||||
from django.conf import settings
|
||||
from textwrap import TextWrapper
|
||||
from copy import deepcopy, copy
|
||||
from evennia.utils.utils import to_unicode, m_len
|
||||
from evennia.utils.ansi import ANSIString
|
||||
|
||||
_DEFAULT_WIDTH = settings.CLIENT_DEFAULT_WIDTH
|
||||
|
||||
def _to_ansi(obj):
|
||||
"""
|
||||
convert to ANSIString.
|
||||
|
|
@ -262,7 +265,7 @@ class ANSITextWrapper(TextWrapper):
|
|||
|
||||
# -- Convenience interface ---------------------------------------------
|
||||
|
||||
def wrap(text, width=70, **kwargs):
|
||||
def wrap(text, width=_DEFAULT_WIDTH, **kwargs):
|
||||
"""
|
||||
Wrap a single paragraph of text, returning a list of wrapped lines.
|
||||
|
||||
|
|
@ -283,7 +286,7 @@ def wrap(text, width=70, **kwargs):
|
|||
w = ANSITextWrapper(width=width, **kwargs)
|
||||
return w.wrap(text)
|
||||
|
||||
def fill(text, width=70, **kwargs):
|
||||
def fill(text, width=_DEFAULT_WIDTH, **kwargs):
|
||||
"""Fill a single paragraph of text, returning a new string.
|
||||
|
||||
Reformat the single paragraph in 'text' to fit in lines of no more
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue