Skip to content

Commit 244cdad

Browse files
committed
【完善】micropython 自动补全
1 parent 475ed5f commit 244cdad

File tree

6 files changed

+34
-34
lines changed

6 files changed

+34
-34
lines changed

docs/code-completion/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self) -> None:
2020
"""
2121
...
2222

23-
def append(val) -> None:
23+
def append(self, val) -> None:
2424
"""
2525
将一个新元素追加到数组的末尾。
2626
示例:
@@ -34,7 +34,7 @@ def append(val) -> None:
3434
"""
3535
...
3636

37-
def extend(iterable) -> None:
37+
def extend(self, iterable) -> None:
3838
"""
3939
将一个新的数组追加到数组的末尾,注意追加的数组和原来数组的数据类型要保持一致。
4040
示例:

docs/code-completion/select.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class poll(string):
4040
def __init__(self) -> None:
4141
...
4242

43-
def register(obj) -> None:
43+
def register(self, obj) -> None:
4444
"""
4545
- register(obj[, eventmask])
4646
注册一个用以监控的对象,并设置被监控对象的监控标志位 flag。
@@ -54,7 +54,7 @@ def register(obj) -> None:
5454
"""
5555
...
5656

57-
def unregister(obj) -> None:
57+
def unregister(self, obj) -> None:
5858
"""
5959
解除监控的对象的注册。
6060
@@ -69,7 +69,7 @@ def unregister(obj) -> None:
6969
"""
7070
...
7171

72-
def modify(obj, eventmask) -> None:
72+
def modify(self, obj, eventmask) -> None:
7373
"""
7474
修改已注册的对象监控标志。
7575
@@ -85,7 +85,7 @@ def modify(obj, eventmask) -> None:
8585
"""
8686
...
8787

88-
def poll(timeout) -> None:
88+
def poll(self, timeout) -> None:
8989
"""
9090
- poll([timeout])
9191
等待至少一个已注册的对象准备就绪。

docs/code-completion/uctypes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class struct(addr, descriptor, type):
3131
def __init__(self) -> None:
3232
...
3333

34-
def sizeof(struct) -> None:
34+
def sizeof(self, struct) -> None:
3535
"""
3636
按字节返回数据的大小。参数可以是类或者数据对象 (或集合)。 示例:
3737
@@ -44,7 +44,7 @@ def sizeof(struct) -> None:
4444
"""
4545
...
4646

47-
def addressof(obj) -> None:
47+
def addressof(self, obj) -> None:
4848
"""
4949
返回对象地址。参数需要是 bytes, bytearray 。 示例:
5050
@@ -54,7 +54,7 @@ def addressof(obj) -> None:
5454
"""
5555
...
5656

57-
def bytes_at(addr, size)-> None:
57+
def bytes_at(self, addr, size)-> None:
5858
"""
5959
捕捉从 addr 开始到 size 个地址偏移量结束的内存数据为 bytearray 对象并返回。 示例:
6060
@@ -64,7 +64,7 @@ def bytes_at(addr, size)-> None:
6464
"""
6565
...
6666

67-
def bytearray_at(addr, size) -> None:
67+
def bytearray_at(self, addr, size) -> None:
6868
"""
6969
捕捉给定大小和地址内存为 bytearray 对象。与 bytes_at() 函数不同的是,它可以被再次写入,可以访问给定地址的参数。 示例:
7070

docs/code-completion/uhashlib.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class sha256(data):
1515
def __init__(self) -> None:
1616
...
1717

18-
def update(data) -> None:
18+
def update(self, data) -> None:
1919
"""将更多二进制数据放入哈希表中。"""
2020
...
2121

22-
def digest() -> None:
22+
def digest(self) -> None:
2323
"""返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
2424
...
2525

26-
def hexdigest() -> None:
26+
def hexdigest(self) -> None:
2727
"""此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
2828
...
2929

@@ -36,15 +36,15 @@ class sha1(data):
3636
def __init__(self) -> None:
3737
...
3838

39-
def update(data) -> None:
39+
def update(self, data) -> None:
4040
"""将更多二进制数据放入哈希表中。"""
4141
...
4242

43-
def digest() -> None:
43+
def digest(self) -> None:
4444
"""返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
4545
...
4646

47-
def hexdigest() -> None:
47+
def hexdigest(self) -> None:
4848
"""此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
4949
...
5050

@@ -58,14 +58,14 @@ class md5(data):
5858
def __init__(self) -> None:
5959
...
6060

61-
def update(data) -> None:
61+
def update(self, data) -> None:
6262
"""将更多二进制数据放入哈希表中。"""
6363
...
6464

65-
def digest() -> None:
65+
def digest(self) -> None:
6666
"""返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
6767
...
6868

69-
def hexdigest() -> None:
69+
def hexdigest(self) -> None:
7070
"""此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
7171
...

docs/code-completion/uio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class BytesIO(string):
2727
def __init__(self) -> None:
2828
...
2929

30-
def getvalue() -> None:
30+
def getvalue(self) -> None:
3131
"""获取缓存区内容。"""
3232
...

docs/code-completion/ure.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ class compile(...):
1414
def __init__(self) -> None:
1515
...
1616

17-
def match(string) -> None:
17+
def match(self, string) -> None:
1818
"""用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
1919
...
2020

21-
def search(string) -> None:
21+
def search(self, string) -> None:
2222
"""在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
2323
...
2424

25-
def sub(replace, string, count, flags) -> None:
25+
def sub(self, replace, string, count, flags) -> None:
2626
"""Compile regex_str and search for it in string, replacing all matches with replace, and returning the new string."""
2727
...
2828

29-
def split() -> None:
29+
def split(self) -> None:
3030
"""获取缓存区内容。"""
3131
...
3232

@@ -39,25 +39,25 @@ class match(...):
3939
def __init__(self) -> None:
4040
...
4141

42-
def group(index) -> None:
42+
def group(self, index) -> None:
4343
"""用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
4444
...
4545

46-
def groups() -> None:
46+
def groups(self) -> None:
4747
"""在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
4848
...
4949

50-
def start(index) -> None:
50+
def start(self, index) -> None:
5151
"""start([index])"""
5252
...
5353

54-
def end(index) -> None:
54+
def end(self, index) -> None:
5555
"""end([index])
5656
Return the index in the original string of the start or end of the substring group that was matched. index defaults to the entire group, otherwise it will select a group.
5757
"""
5858
...
5959

60-
def span() -> None:
60+
def span(self) -> None:
6161
"""Returns the 2-tuple (match.start(index), match.end(index))."""
6262
...
6363

@@ -70,25 +70,25 @@ class search(...):
7070
def __init__(self) -> None:
7171
...
7272

73-
def group(index) -> None:
73+
def group(self, index) -> None:
7474
"""用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
7575
...
7676

77-
def groups() -> None:
77+
def groups(self) -> None:
7878
"""在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
7979
...
8080

81-
def start(index) -> None:
81+
def start(self, index) -> None:
8282
"""start([index])"""
8383
...
8484

85-
def end(index) -> None:
85+
def end(self, index) -> None:
8686
"""end([index])
8787
Return the index in the original string of the start or end of the substring group that was matched. index defaults to the entire group, otherwise it will select a group.
8888
"""
8989
...
9090

91-
def span() -> None:
91+
def span(self) -> None:
9292
"""Returns the 2-tuple (match.start(index), match.end(index))."""
9393
...
9494

0 commit comments

Comments
 (0)