all: Fix strings with backslash by using raw string literals.

pull/10993/head
Christian Clauss 2023-03-10 06:28:44 +01:00 zatwierdzone przez Damien George
rodzic cda292935d
commit 8f8bd98164
4 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -233,7 +233,7 @@ latex_elements = {
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
#'preamble': '', #'preamble': '',
# Include 3 levels of headers in PDF ToC # Include 3 levels of headers in PDF ToC
'preamble': '\setcounter{tocdepth}{2}', 'preamble': r'\setcounter{tocdepth}{2}',
} }
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples

Wyświetl plik

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
""" r"""
Flash the WiPy (format, update service pack and program). Flash the WiPy (format, update service pack and program).
Example: Example:

Wyświetl plik

@ -16,7 +16,7 @@ def parse_usb_ids(filename):
rv = dict() rv = dict()
for line in open(filename).readlines(): for line in open(filename).readlines():
line = line.rstrip("\r\n") line = line.rstrip("\r\n")
match = re.match("^#define\s+(\w+)\s+\(0x([0-9A-Fa-f]+)\)$", line) match = re.match(r"^#define\s+(\w+)\s+\(0x([0-9A-Fa-f]+)\)$", line)
if match and match.group(1).startswith(config_prefix): if match and match.group(1).startswith(config_prefix):
key = match.group(1).replace(config_prefix, "USB_") key = match.group(1).replace(config_prefix, "USB_")
val = match.group(2) val = match.group(2)

Wyświetl plik

@ -271,7 +271,7 @@ def get_drives():
] ]
) )
for line in to_str(r).split("\n"): for line in to_str(r).split("\n"):
words = re.split("\s+", line) words = re.split(r"\s+", line)
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT": if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
drives.append(words[0]) drives.append(words[0])
else: else: