Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/config.py @ 326:b7abfbfe806d
By default quote '"' and "'" also
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 06 May 2021 22:16:56 +0200 |
| parents | ab33d51f3412 |
| children | d81d2cdf4925 |
comparison
equal
deleted
inserted
replaced
| 325:ab33d51f3412 | 326:b7abfbfe806d |
|---|---|
| 382 qc = klass._QUOTE | 382 qc = klass._QUOTE |
| 383 s = s.replace(qc, qc + "x25") | 383 s = s.replace(qc, qc + "x25") |
| 384 s = s.replace(klass._DOT, qc + "x2e") | 384 s = s.replace(klass._DOT, qc + "x2e") |
| 385 s = s.replace(klass._NS_SEPARATOR, qc + "x3a") | 385 s = s.replace(klass._NS_SEPARATOR, qc + "x3a") |
| 386 s = s.replace(klass._COMMENT, qc + "x23") | 386 s = s.replace(klass._COMMENT, qc + "x23") |
| 387 return s.replace(klass._FILTER_SEPARATOR, qc + "x7c") | 387 s = s.replace(klass._FILTER_SEPARATOR, qc + "x7c") |
| 388 s = s.replace('"', qc + "x22") | |
| 389 return s.replace("'", qc + "x27") | |
| 388 | 390 |
| 389 @classmethod | 391 @classmethod |
| 390 def unquote(klass, s): | 392 def unquote(klass, s): |
| 391 """Unquote the content of `s`: handle all patterns ``%xXX``, | 393 """Unquote the content of `s`: handle all patterns ``%xXX``, |
| 392 ``%uXXXX`` or `%UXXXXXXXX`` | 394 ``%uXXXX`` or `%UXXXXXXXX`` |
