| 497 | return list(value) |
| 498 | |
| 499 | def __serialiseStringArrayWithEscape( parameter, value ) : |
| 500 | |
| 501 | acceptFlags = False |
| 502 | if "parser" in parameter.userData() and "acceptFlags" in parameter.userData()["parser"] : |
| 503 | acceptFlags = parameter.userData()["parser"]["acceptFlags"].value |
| 504 | |
| 505 | if acceptFlags : |
| 506 | return list(value) |
| 507 | else : |
| 508 | # when serialising string arrays that can start with "-" |
| 509 | # we take care to escape it with a leading "\", |
| 510 | # so it won't be confused with a new argument name |
| 511 | # we also escape anything that starts with any number of "\" followed by a "-" |
| 512 | # so they don't confused with an intentional escape |
| 513 | return [ "\\{}".format( x ) if re.match( r"^\\*-.*", x ) else x for x in value ] |
| 514 | |
| 515 | def __serialiseUsingStr( parameter, value ) : |
| 516 | |