File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 20
20
if not os .path .isdir (module_path ):
21
21
continue
22
22
pyi_lines = []
23
- for class_file in os .listdir (module_path ):
23
+ classes = os .listdir (module_path )
24
+ classes = [x for x in sorted (classes ) if x .endswith (".c" )]
25
+ if classes [- 1 ] == "__init__.c" :
26
+ classes .insert (0 , classes .pop ())
27
+ for class_file in classes :
24
28
class_path = os .path .join (module_path , class_file )
25
29
with open (class_path , "r" ) as f :
26
30
for line in f :
27
- if line .startswith ("//| " ):
28
- pyi_lines .append (line [4 :])
31
+ if line .startswith ("//|" ):
32
+ if line [3 ] == " " :
33
+ line = line [4 :]
34
+ elif line [3 ] == "\n " :
35
+ line = line [3 :]
36
+ else :
37
+ continue
38
+ pyi_lines .append (line )
29
39
30
40
stub_filename = os .path .join (stub_directory , module + ".pyi" )
31
41
print (stub_filename )
You can’t perform that action at this time.
0 commit comments