mirror of https://github.com/ksherlock/prez.git
string examples.
This commit is contained in:
parent
feeb5f260e
commit
c4c833c898
4
base.py
4
base.py
|
@ -406,7 +406,7 @@ class rStringList(rObject):
|
|||
rName = "rStringList"
|
||||
rType = 0x8007
|
||||
|
||||
def __init__(self, strings, **kwargs):
|
||||
def __init__(self, *strings, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.children = [str_to_bytes(x) for x in strings]
|
||||
|
||||
|
@ -419,7 +419,7 @@ class rStringList(rObject):
|
|||
|
||||
def _rez_string(self):
|
||||
rv = "\t{\n"
|
||||
rv += ",\n".join([format_string_multi(x) for x in self.children])
|
||||
rv += ",\n".join([multi_format_string(x, "\t\t") for x in self.children])
|
||||
if self.children: rv += "\n"
|
||||
rv += "\t}"
|
||||
return rv
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# text can be a python string or a bytes object.
|
||||
# strings are assumed to be utf-8 encoded and will be converted to macroman
|
||||
# bytes are left as-is
|
||||
#
|
||||
# n.b. - in Rez, \r and \n are reversed.
|
||||
# In prez, they have their standard (python) meaning.
|
||||
#
|
||||
|
||||
rText("rText")
|
||||
rTextBlock(b"rTextBlock") # bytes
|
||||
rTextForLETextBox2("rTextForLETextBox2")
|
||||
rAlertString("rAlertString")
|
||||
rErrorString("rErrorString")
|
||||
|
||||
|
||||
from textwrap import dedent
|
||||
rComment(dedent("""
|
||||
rComment
|
||||
|
||||
multi-line python string.
|
||||
""")) # remove leading space from the mult-line string.
|
||||
rPString("rPString")
|
||||
rCString("rCString")
|
||||
rWString("rWString")
|
||||
rC1InputString("rC1InputString")
|
||||
|
||||
rStringList('rStringList', b"rStringList", r"rStringList")
|
Loading…
Reference in New Issue