forked from pythonarcade/arcade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_package.py
39 lines (26 loc) · 888 Bytes
/
list_package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import re
import os
def print_functions(file_name):
file_handle = open(file_name)
file_contents = file_handle.read()
# print(file_contents)
matches = re.findall("\ndef (\w+)", file_contents)
for match in matches:
print(match)
def print_classes(file_name):
file_handle = open(file_name)
file_contents = file_handle.read()
# print(file_contents)
matches = re.findall("\nclass (\w+)", file_contents)
for match in matches:
print(match)
for root, dirs, files in os.walk("arcade"):
for file_name in files:
if file_name.endswith(".py"):
file_name = os.path.join(root, file_name)
print("-----------")
print("\nFile: {}".format(file_name))
print("FUNCTIONS:")
print_functions(file_name)
print("\nCLASSES:")
print_classes(file_name)