Просмотр исходного кода

【完善】micropython 自动补全

SummerGift 6 лет назад
Родитель
Сommit
244cdadb49

+ 2 - 2
docs/code-completion/array.py

@@ -20,7 +20,7 @@ class array(object):
     """
     ...
 
-    def append(val) -> None:
+    def append(self, val) -> None:
         """
         将一个新元素追加到数组的末尾。
         示例:
@@ -34,7 +34,7 @@ class array(object):
         """
         ...
 
-    def extend(iterable) -> None:
+    def extend(self, iterable) -> None:
         """
         将一个新的数组追加到数组的末尾,注意追加的数组和原来数组的数据类型要保持一致。
         示例:

+ 4 - 4
docs/code-completion/select.py

@@ -40,7 +40,7 @@ class poll(string):
     def __init__(self) -> None:
     ...
 
-    def register(obj) -> None:
+    def register(self, obj) -> None:
         """
         - register(obj[, eventmask])
         注册一个用以监控的对象,并设置被监控对象的监控标志位 flag。
@@ -54,7 +54,7 @@ class poll(string):
         """
         ...
 
-    def unregister(obj) -> None:
+    def unregister(self, obj) -> None:
         """
         解除监控的对象的注册。
 
@@ -69,7 +69,7 @@ class poll(string):
         """
         ...
 
-    def modify(obj, eventmask) -> None:
+    def modify(self, obj, eventmask) -> None:
         """
         修改已注册的对象监控标志。
 
@@ -85,7 +85,7 @@ class poll(string):
         """
         ...
 
-    def poll(timeout) -> None:
+    def poll(self, timeout) -> None:
         """
         - poll([timeout])
         等待至少一个已注册的对象准备就绪。

+ 4 - 4
docs/code-completion/uctypes.py

@@ -31,7 +31,7 @@ class struct(addr, descriptor, type):
     def __init__(self) -> None:
     ...
 
-    def sizeof(struct) -> None:
+    def sizeof(self, struct) -> None:
         """
         按字节返回数据的大小。参数可以是类或者数据对象 (或集合)。 示例:
 
@@ -44,7 +44,7 @@ class struct(addr, descriptor, type):
         """
         ...
 
-    def addressof(obj) -> None:
+    def addressof(self, obj) -> None:
         """
         返回对象地址。参数需要是 bytes, bytearray 。 示例:
 
@@ -54,7 +54,7 @@ class struct(addr, descriptor, type):
         """
         ...
 
-    def bytes_at(addr, size)-> None:
+    def bytes_at(self, addr, size)-> None:
         """
         捕捉从 addr 开始到 size 个地址偏移量结束的内存数据为 bytearray 对象并返回。 示例:
 
@@ -64,7 +64,7 @@ class struct(addr, descriptor, type):
         """
         ...
 
-    def bytearray_at(addr, size) -> None:
+    def bytearray_at(self, addr, size) -> None:
         """
         捕捉给定大小和地址内存为 bytearray 对象。与 bytes_at() 函数不同的是,它可以被再次写入,可以访问给定地址的参数。 示例:
 

+ 9 - 9
docs/code-completion/uhashlib.py

@@ -15,15 +15,15 @@ class sha256(data):
     def __init__(self) -> None:
     ...
 
-    def update(data) -> None:
+    def update(self, data) -> None:
         """将更多二进制数据放入哈希表中。"""
         ...
 
-    def digest() -> None:
+    def digest(self) -> None:
         """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
         ...
 
-    def hexdigest() -> None:
+    def hexdigest(self) -> None:
         """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
         ...
 
@@ -36,15 +36,15 @@ class sha1(data):
     def __init__(self) -> None:
     ...
 
-    def update(data) -> None:
+    def update(self, data) -> None:
         """将更多二进制数据放入哈希表中。"""
         ...
 
-    def digest() -> None:
+    def digest(self) -> None:
         """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
         ...
 
-    def hexdigest() -> None:
+    def hexdigest(self) -> None:
         """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
         ...
 
@@ -58,14 +58,14 @@ class md5(data):
     def __init__(self) -> None:
     ...
 
-    def update(data) -> None:
+    def update(self, data) -> None:
         """将更多二进制数据放入哈希表中。"""
         ...
 
-    def digest() -> None:
+    def digest(self) -> None:
         """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
         ...
 
-    def hexdigest() -> None:
+    def hexdigest(self) -> None:
         """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
         ...

+ 1 - 1
docs/code-completion/uio.py

@@ -27,6 +27,6 @@ class BytesIO(string):
     def __init__(self) -> None:
     ...
 
-    def getvalue() -> None:
+    def getvalue(self) -> None:
         """获取缓存区内容。"""
         ...

+ 14 - 14
docs/code-completion/ure.py

@@ -14,19 +14,19 @@ class compile(...):
     def __init__(self) -> None:
     ...
 
-    def match(string) -> None:
+    def match(self, string) -> None:
         """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
         ...
 
-    def search(string) -> None:
+    def search(self, string) -> None:
         """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
         ...
 
-    def sub(replace, string, count, flags) -> None:
+    def sub(self, replace, string, count, flags) -> None:
         """Compile regex_str and search for it in string, replacing all matches with replace, and returning the new string."""
         ...
 
-    def split() -> None:
+    def split(self) -> None:
         """获取缓存区内容。"""
         ...
 
@@ -39,25 +39,25 @@ class match(...):
     def __init__(self) -> None:
     ...
 
-    def group(index) -> None:
+    def group(self, index) -> None:
         """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
         ...
 
-    def groups() -> None:
+    def groups(self) -> None:
         """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
         ...
 
-    def start(index) -> None:
+    def start(self, index) -> None:
         """start([index])"""
         ...
 
-    def end(index) -> None:
+    def end(self, index) -> None:
         """end([index])
         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.
         """
         ...
 
-    def span() -> None:
+    def span(self) -> None:
         """Returns the 2-tuple (match.start(index), match.end(index))."""
         ...
 
@@ -70,25 +70,25 @@ class search(...):
     def __init__(self) -> None:
     ...
 
-    def group(index) -> None:
+    def group(self, index) -> None:
         """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
         ...
 
-    def groups() -> None:
+    def groups(self) -> None:
         """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
         ...
 
-    def start(index) -> None:
+    def start(self, index) -> None:
         """start([index])"""
         ...
 
-    def end(index) -> None:
+    def end(self, index) -> None:
         """end([index])
         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.
         """
         ...
 
-    def span() -> None:
+    def span(self) -> None:
         """Returns the 2-tuple (match.start(index), match.end(index))."""
         ...