Skip to content

Commit a7bc26a

Browse files
committed
Black formatting
1 parent 641c1c2 commit a7bc26a

File tree

14 files changed

+609
-407
lines changed

14 files changed

+609
-407
lines changed

docs/conf_common.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424

2525
# Conditional content
2626

27-
extensions += ['sphinx_copybutton',
28-
'sphinx_tabs.tabs',
29-
'esp_docs.esp_extensions.dummy_build_system',
30-
]
27+
extensions += [
28+
"sphinx_copybutton",
29+
"sphinx_tabs.tabs",
30+
"esp_docs.esp_extensions.dummy_build_system",
31+
]
3132

3233
# ESP32_DOCS = [
3334
# "index.rst",

docs/en/conf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@
1212
except ImportError:
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('../'))
15+
16+
sys.path.insert(0, os.path.abspath("../"))
1617
from conf_common import * # noqa: F403,F401
1718

1819
import datetime
20+
1921
current_year = datetime.datetime.now().year
2022

2123
# General information about the project.
22-
project = u'Arduino ESP32'
23-
copyright = u'2016 - {}, Espressif Systems (Shanghai) Co., Ltd'.format(current_year)
24-
pdf_title = u'Arduino ESP32 Documentation Guide'
24+
project = "Arduino ESP32"
25+
copyright = "2016 - {}, Espressif Systems (Shanghai) Co., Ltd".format(current_year)
26+
pdf_title = "Arduino ESP32 Documentation Guide"
2527

2628
# The language for content autogenerated by Sphinx. Refer to documentation
2729
# for a list of supported languages.
28-
language = 'en'
30+
language = "en"
2931

3032
# Tracking ID for Google Analytics
31-
google_analytics_id = 'G-F58JM78930'
33+
google_analytics_id = "G-F58JM78930"

libraries/ESP_SR/tools/gen_sr_commands.py

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,83 @@
2828
# { 7, "Pause playback", "PeZ PLdBaK"},
2929
# };
3030

31+
3132
def english_g2p(text):
3233
g2p = G2p()
3334
out = "static const sr_cmd_t sr_commands[] = {\n"
3435
enum = "enum {\n"
35-
alphabet={"AE1": "a", "N": "N", " ": " ", "OW1": "b", "V": "V", "AH0": "c", "L": "L", "F": "F", "EY1": "d", "S": "S", "B": "B", "R": "R", "AO1": "e", "D": "D", "AH1": "c", "EH1": "f", "OW0": "b", "IH0": "g", "G": "G", "HH": "h", "K": "K", "IH1": "g", "W": "W", "AY1": "i", "T": "T", "M": "M", "Z": "Z", "DH": "j", "ER0": "k", "P": "P", "NG": "l", "IY1": "m", "AA1": "n", "Y": "Y", "UW1": "o", "IY0": "m", "EH2": "f", "CH": "p", "AE0": "a", "JH": "q", "ZH": "r", "AA2": "n", "SH": "s", "AW1": "t", "OY1": "u", "AW2": "t", "IH2": "g", "AE2": "a", "EY2": "d", "ER1": "k", "TH": "v", "UH1": "w", "UW2": "o", "OW2": "b", "AY2": "i", "UW0": "o", "AH2": "c", "EH0": "f", "AW0": "t", "AO2": "e", "AO0": "e", "UH0": "w", "UH2": "w", "AA0": "n", "AY0": "i", "IY2": "m", "EY0": "d", "ER2": "k", "OY2": "u", "OY0": "u"}
36+
alphabet = {
37+
"AE1": "a",
38+
"N": "N",
39+
" ": " ",
40+
"OW1": "b",
41+
"V": "V",
42+
"AH0": "c",
43+
"L": "L",
44+
"F": "F",
45+
"EY1": "d",
46+
"S": "S",
47+
"B": "B",
48+
"R": "R",
49+
"AO1": "e",
50+
"D": "D",
51+
"AH1": "c",
52+
"EH1": "f",
53+
"OW0": "b",
54+
"IH0": "g",
55+
"G": "G",
56+
"HH": "h",
57+
"K": "K",
58+
"IH1": "g",
59+
"W": "W",
60+
"AY1": "i",
61+
"T": "T",
62+
"M": "M",
63+
"Z": "Z",
64+
"DH": "j",
65+
"ER0": "k",
66+
"P": "P",
67+
"NG": "l",
68+
"IY1": "m",
69+
"AA1": "n",
70+
"Y": "Y",
71+
"UW1": "o",
72+
"IY0": "m",
73+
"EH2": "f",
74+
"CH": "p",
75+
"AE0": "a",
76+
"JH": "q",
77+
"ZH": "r",
78+
"AA2": "n",
79+
"SH": "s",
80+
"AW1": "t",
81+
"OY1": "u",
82+
"AW2": "t",
83+
"IH2": "g",
84+
"AE2": "a",
85+
"EY2": "d",
86+
"ER1": "k",
87+
"TH": "v",
88+
"UH1": "w",
89+
"UW2": "o",
90+
"OW2": "b",
91+
"AY2": "i",
92+
"UW0": "o",
93+
"AH2": "c",
94+
"EH0": "f",
95+
"AW0": "t",
96+
"AO2": "e",
97+
"AO0": "e",
98+
"UH0": "w",
99+
"UH2": "w",
100+
"AA0": "n",
101+
"AY0": "i",
102+
"IY2": "m",
103+
"EY0": "d",
104+
"ER2": "k",
105+
"OY2": "u",
106+
"OY0": "u",
107+
}
36108

37109
cmd_id = 0
38110
phrase_id = 0
@@ -49,9 +121,9 @@ def english_g2p(text):
49121
continue
50122
else:
51123
phoneme += alphabet[char]
52-
out += " { "+str(cmd_id)+", \""+phrase+"\", \""+phoneme+"\"},\n"
124+
out += " { " + str(cmd_id) + ', "' + phrase + '", "' + phoneme + '"},\n'
53125
if phrase_id == 0:
54-
enum += " SR_CMD_"+phrase.upper().replace(" ", "_")+",\n"
126+
enum += " SR_CMD_" + phrase.upper().replace(" ", "_") + ",\n"
55127
phrase_id += 1
56128
cmd_id += 1
57129
out += "};"
@@ -62,10 +134,11 @@ def english_g2p(text):
62134

63135
return out
64136

137+
65138
if __name__ == "__main__":
66139

67140
parser = argparse.ArgumentParser(prog="English Speech Commands G2P")
68-
parser.add_argument("text", type=str, default=None, help="input text")
141+
parser.add_argument("text", type=str, default=None, help="input text")
69142
args = parser.parse_args()
70143

71144
if args.text is not None:

libraries/WiFi/examples/WiFiUDPClient/udp_server.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
import socket
44
import sys
55

6-
try :
6+
try:
77
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
88
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
9-
except socket.error as msg :
10-
print('Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1])
9+
except socket.error as msg:
10+
print("Failed to create socket. Error Code : " + str(msg[0]) + " Message " + msg[1])
1111
sys.exit()
1212

1313
try:
14-
s.bind(('', 3333))
14+
s.bind(("", 3333))
1515
except socket.error as msg:
16-
print('Bind failed. Error: ' + str(msg[0]) + ': ' + msg[1])
16+
print("Bind failed. Error: " + str(msg[0]) + ": " + msg[1])
1717
sys.exit()
18-
19-
print('Server listening')
18+
19+
print("Server listening")
2020

2121
while 1:
2222
d = s.recvfrom(1024)
2323
data = d[0]
2424

2525
if not data:
2626
break
27-
27+
2828
print(data.strip())
29-
29+
3030
s.close()

tests/democfg/test_democfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def test_cfg(dut):
2-
dut.expect('Hello cfg!')
2+
dut.expect("Hello cfg!")

tests/hello_world/test_hello_world.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def test_hello_world(dut):
2-
dut.expect('Hello Arduino!')
2+
dut.expect("Hello Arduino!")

tests/nvs/test_nvs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def test_nvs(dut):
2-
dut.expect('Current counter value: 0')
3-
dut.expect('Current counter value: 1')
4-
dut.expect('Current counter value: 2')
5-
dut.expect('Current counter value: 3')
6-
dut.expect('Current counter value: 4')
7-
dut.expect('Current counter value: 5')
2+
dut.expect("Current counter value: 0")
3+
dut.expect("Current counter value: 1")
4+
dut.expect("Current counter value: 2")
5+
dut.expect("Current counter value: 3")
6+
dut.expect("Current counter value: 4")
7+
dut.expect("Current counter value: 5")

tests/periman/test_periman.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
def test_periman(dut):
2-
peripherals = ["GPIO", "SigmaDelta", "LEDC", "RMT", "I2S", "I2C", "SPI",
3-
"ADC_Oneshot", "ADC_Continuous", "DAC", "Touch"]
2+
peripherals = [
3+
"GPIO",
4+
"SigmaDelta",
5+
"LEDC",
6+
"RMT",
7+
"I2S",
8+
"I2C",
9+
"SPI",
10+
"ADC_Oneshot",
11+
"ADC_Continuous",
12+
"DAC",
13+
"Touch",
14+
]
415

516
pattern = rb"(?:\b\w+\b test: This should(?: not)? be printed|Peripheral Manager test done)"
617

0 commit comments

Comments
 (0)