mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 20:47:17 +02:00
Removing test with ANSIString for the moment. It might not be suited for evform due to regex handling.
This commit is contained in:
parent
9b1f376117
commit
c09d6eef53
3 changed files with 5 additions and 5 deletions
|
|
@ -15,6 +15,7 @@ user.
|
|||
"""
|
||||
import re
|
||||
from src.utils import utils
|
||||
from src.utils.utils import to_str
|
||||
|
||||
# ANSI definitions
|
||||
|
||||
|
|
@ -355,7 +356,7 @@ class ANSIString(unicode):
|
|||
string to be handled as already decoded. It is important not to double
|
||||
decode strings, as escapes can only be respected once.
|
||||
"""
|
||||
string = args[0]
|
||||
string = to_str(args[0], force_string=True)
|
||||
if not isinstance(string, basestring):
|
||||
string = str(string)
|
||||
parser = kwargs.get('parser', ANSI_PARSER)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ This produces the following result:
|
|||
| |**|* | Herbalism |14 |990/1400 |
|
||||
| |* | | Smithing |9 |205/900 |
|
||||
| | |
|
||||
------------------------------------------------
|
||||
`----------------------------------------------´
|
||||
|
||||
The marked forms have been replaced with Cells of text and with
|
||||
EvTables. The form can be updated by simply re-applying form.map()
|
||||
|
|
@ -120,7 +120,6 @@ form will raise an error.
|
|||
|
||||
import re
|
||||
import copy
|
||||
from src.utils.ansi import ANSIString
|
||||
from src.utils.evtable import Cell, EvTable
|
||||
from src.utils.utils import all_from_module, to_str, to_unicode
|
||||
|
||||
|
|
@ -371,7 +370,7 @@ class EvForm(object):
|
|||
self.tablechar = tablechar[0] if len(tablechar) > 1 else tablechar
|
||||
|
||||
# split into a list of list of lines. Form can be indexed with form[iy][ix]
|
||||
self.raw_form = ANSIString(datadict.get("FORM", "")).split("\n")
|
||||
self.raw_form = to_unicode(datadict.get("FORM", "")).split("\n")
|
||||
# strip first line
|
||||
self.raw_form = self.raw_form[1:] if self.raw_form else self.raw_form
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ FORMCHAR = "x"
|
|||
TABLECHAR = "c"
|
||||
|
||||
FORM = """
|
||||
.------------------------------------------------.
|
||||
{c.------------------------------------------------.
|
||||
| |
|
||||
| Name: xxxxx1xxxxx Player: xxxxxxx2xxxxxxx |
|
||||
| xxxxxxxxxxx |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue